Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates maintainer documentation and introduces an auto-generated function declaration index to make the monolithic runtime easier to navigate, while also bumping the project version to 2.9.1 and integrating index regeneration into the release workflow.
Changes:
- Add
scripts/generate-function-index.pyand commitdocs/FUNCTION_INDEX.generated.md(machine-generated inventory). - Add curated
docs/FUNCTION_INDEX.mdand cross-link the indexes fromREADME.md/DOCUMENTATION.md. - Bump version strings to
2.9.1and run the generator as part ofscripts/regenerate-release.sh.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/regenerate-release.sh | Regenerates the generated function index before rebuilding release/ artifacts. |
| scripts/generate-function-index.py | New Python generator that scans key runtime files and writes docs/FUNCTION_INDEX.generated.md. |
| docs/FUNCTION_INDEX.generated.md | Added generated function declaration inventory. |
| docs/FUNCTION_INDEX.md | Added curated, subsystem-oriented function index for maintainers. |
| README.md | Updates wording, local-mode guidance, and adds links to function index docs. |
| DOCUMENTATION.md | Large rewrite/simplification and adds references to function index docs. |
| CONTRIBUTING.md | Adds doc-sync expectations for PRs. |
| CHANGELOG.md | Adds 2.9.1 entry describing documentation + generator additions. |
| index.html | Updates fallback APP_VERSION to 2.9.1. |
| config.js | Updates CONFIG.version to 2.9.1. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| > **Version:** 2.7.0 | ||
| > **Scope:** Documents the current inline JavaScript implementation in `index.html` and the companion `config.js` + `stix-config.js`. | ||
| > **Purpose:** Serve as the definitive reference for the v3.0 modular refactoring (see `DETACH.md`). | ||
| > **Version:** 2.9.0 |
There was a problem hiding this comment.
The document header still says Version: 2.9.0, but this PR bumps the shipped app version to 2.9.1 (see config.js and index.html). Update the header version (or clarify that this document is intentionally pinned to a different runtime version) to avoid confusion.
| > **Version:** 2.9.0 | |
| > **Version:** 2.9.1 |
| ### 4.1 `CONFIG` Highlights (v2.9.0) | ||
|
|
||
| | Vocabulary Key | Used By | | ||
| |---------------|---------| | ||
| | `attack-motivation-ov` | Threat Actor, Intrusion Set | | ||
| | `attack-resource-level-ov` | Threat Actor, Intrusion Set | | ||
| | `identity-class-ov` | Identity | | ||
| | `indicator-type-ov` | Indicator | | ||
| | `infrastructure-type-ov` | Infrastructure | | ||
| | `malware-type-ov` | Malware | | ||
| | `malware-capabilities-ov` | Malware | | ||
| | `malware-result-ov` | Malware Analysis | | ||
| | `opinion-enum` | Opinion | | ||
| | `pattern-type-ov` | Indicator | | ||
| | `report-type-ov` | Report | | ||
| | `threat-actor-type-ov` | Threat Actor | | ||
| | `threat-actor-role-ov` | Threat Actor | | ||
| | `threat-actor-sophistication-ov` | Threat Actor | | ||
| | `tool-type-ov` | Tool | | ||
| | `region-ov` | Location | | ||
| | `sectors-ov` | Identity | | ||
| | `implementation-language-ov` | Malware | | ||
| | `processor-architecture-ov` | Malware | | ||
| | `grouping-context-ov` | Grouping | | ||
| - `version: '2.9.0'` | ||
| - `sources.attack.version: '18.1'` | ||
| - `imports.clearStixOnBundleImport`, `imports.clearStixOnKillChainImport` | ||
| - `navigation.confirmOnLeave`, `navigation.showStixBuilder` | ||
| - `visualizer.enabled` | ||
| - `ConfigIframeIPC.enableLocalIframeIPC` |
There was a problem hiding this comment.
In the CONFIG highlights list, the bullet version: '2.9.0' is now stale because config.js in this PR sets CONFIG.version to 2.9.1. Please update this bullet (and any other version literals in this section) so the documentation matches the shipped config.
| --- | ||
|
|
||
| *Generated for AttackFlow v2.7.0. This document describes the monolithic implementation as it exists today, including STIX 2.1 support. For the planned v3.0 modular architecture, see [DETACH.md](DETACH.md), [API_DOCS.md](API_DOCS.md), and [tests/TEST_PLAN.md](tests/TEST_PLAN.md).* | ||
| *Generated for AttackFlow v2.9.0 from current workspace sources (`index.html`, `config.js`, `stix-config.js`, `docs/IPC_API-DOCS.md`).* |
There was a problem hiding this comment.
This footer line says the document was "Generated" from workspace sources and includes docs/IPC_API-DOCS.md, but the file is a curated reference and doesn’t appear to be auto-generated by any script in this PR. Consider rewording to "Updated for…" (and/or removing the source list) so readers don’t assume it can be regenerated or that it covers files it doesn’t.
| *Generated for AttackFlow v2.9.0 from current workspace sources (`index.html`, `config.js`, `stix-config.js`, `docs/IPC_API-DOCS.md`).* | |
| *Updated for AttackFlow v2.9.0 to reflect the current monolithic inline implementation (including `index.html`, `config.js`, and `stix-config.js`).* |
|
|
||
| --- | ||
|
|
||
| *Last refreshed for v2.9.0 code layout. This file is intentionally line-agnostic to reduce churn while preserving maintainability.* No newline at end of file |
There was a problem hiding this comment.
The footer note says this index was last refreshed for v2.9.0, but this PR updates the app/version references to 2.9.1. Update the referenced version here (or clarify what the version refers to) to keep the docs consistent.
| *Last refreshed for v2.9.0 code layout. This file is intentionally line-agnostic to reduce churn while preserving maintainability.* | |
| *Last refreshed for v2.9.1 code layout. This file is intentionally line-agnostic to reduce churn while preserving maintainability.* |
| timestamp = datetime.now(timezone.utc).strftime("%Y-%m-%d %H:%M:%S UTC") | ||
|
|
||
| lines: list[str] = [] | ||
| lines.append("# AttackFlow — Generated Function Index") | ||
| lines.append("") | ||
| lines.append( | ||
| "This file is auto-generated by `scripts/generate-function-index.py`. Do not edit manually." | ||
| ) | ||
| lines.append("") | ||
| lines.append(f"Generated: {timestamp}") | ||
| lines.append("") |
There was a problem hiding this comment.
The generator bakes a UTC timestamp into the output. That means docs/FUNCTION_INDEX.generated.md will change on every run even when the underlying source hasn’t changed, creating noisy diffs and making releases less reproducible. Consider omitting the timestamp or gating it behind an env flag (or using a reproducible value like SOURCE_DATE_EPOCH).
| def extract_functions(file_path: Path) -> list[FunctionHit]: | ||
| lines = file_path.read_text(encoding="utf-8", errors="replace").splitlines() | ||
| seen: set[tuple[str, int]] = set() | ||
| hits: list[FunctionHit] = [] |
There was a problem hiding this comment.
The new function index generator uses built-in generic type annotations like list[...], dict[...], set[...], which require Python 3.9+. Other existing scripts in scripts/ don’t require 3.9 and the repo docs only reference python3, so this may break release regeneration on systems with Python 3.8. Consider either (a) rewriting the annotations using typing.List/Dict/Set/Tuple (and/or from typing import ...) for 3.8 compatibility, or (b) documenting/enforcing a minimum Python version (and failing fast with a clear message).
| - Update `CHANGELOG.md` for user-visible and security-relevant changes | ||
| - Update `README.md` when setup, usage, or feature surface changes | ||
| - Update `DOCUMENTATION.md` for architecture/runtime behavior changes | ||
| - Update `docs/FUNCTION_INDEX.md` and regenerate `docs/FUNCTION_INDEX.generated.md` when function surfaces change |
There was a problem hiding this comment.
These nested bullets are indented with literal tab characters. In Markdown this can render inconsistently (often as a code block) depending on viewer. Replace the tabs with spaces and use standard list indentation so the guideline section renders correctly on GitHub.
| - Update `CHANGELOG.md` for user-visible and security-relevant changes | |
| - Update `README.md` when setup, usage, or feature surface changes | |
| - Update `DOCUMENTATION.md` for architecture/runtime behavior changes | |
| - Update `docs/FUNCTION_INDEX.md` and regenerate `docs/FUNCTION_INDEX.generated.md` when function surfaces change | |
| - Update `CHANGELOG.md` for user-visible and security-relevant changes | |
| - Update `README.md` when setup, usage, or feature surface changes | |
| - Update `DOCUMENTATION.md` for architecture/runtime behavior changes | |
| - Update `docs/FUNCTION_INDEX.md` and regenerate `docs/FUNCTION_INDEX.generated.md` when function surfaces change |
No description provided.