You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactor(128): simplify code per /simplify review
Production (scripts/extract-infographic-data.py):
- Move datetime import to module level
- Add module-level constants: _QUALIFYING_SEVERITIES, _SEVERITY_FIELD_PREFERENCE,
_TIER_SOURCE_LABEL
- Promote duplicated severity extractor closures to _canonical_severity
- Promote _extract_composite_score and _extract_description to module level
- Remove dead parameter threats_content from _build_executive_architecture_payload
- Delete _SEV_RANK local dict, use imported _SEVERITY_ORDINAL directly
- Delete task-reference and step-enumeration comments (F-128, T011, --- Step 1 ---)
- Trim verbose helper docstrings to single-line PEP 257 summaries
Tests (5 files):
- Remove T0NN task references, F-128 banners, and point-in-time gate notes
- Strip # Step 1..6 narrative comments in test bodies
- Trim oversized module docstrings to intent-only
- Apply @pytest.mark.slow to typst-compiling tests
- Consolidate 5 identical subprocess runs in test_existing_image_flags_unchanged
into a module-scoped agentic_app_report_typst fixture (5x subprocess to 1x)
Infrastructure (pyproject.toml):
- Register slow pytest marker so `pytest -m "not slow"` enables fast iteration
Verification:
- Full suite: 39 tests pass in ~20s
- Fast suite: pytest -m "not slow" runs 32 tests in ~5s (4x speedup)
- Production smoke test against agentic-app sample produces identical output
Co-Authored-By: Claude <noreply@anthropic.com>
* docs(128): add docstrings per docs-lint
Add single-line summaries to two promoted helpers (_extract_composite_score,
_extract_description) that were extracted from closures during the simplify
refactor and lacked documentation.
Co-Authored-By: Claude <noreply@anthropic.com>
* docs(128): update CHANGELOG
Append Feature 128 (Executive Threat Architecture Infographic) entry to
## [Unreleased] / ### Added. Describes the new template, the PDF placement
rationale, the `exec` alias, `all` expansion inclusion, the pytest bootstrap,
and the backward-compatibility guarantee via committed .baseline PDFs.
Co-Authored-By: Claude <noreply@anthropic.com>
* docs(128): review KB entries
Add KB-027 capturing the magnitude of the post-delivery simplify pass on
F-128: 31% reduction in changed-line count (660 deletions, 216 insertions
against 2,139 new lines), dominated by narrative-comment sprawl in the
generated test modules. Recommends treating /aod.document simplify as a
mandatory cleanup gate rather than optional polish.
Bump entry count 26 to 27.
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,6 +25,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
25
25
26
26
### Added
27
27
28
+
-**Executive Threat Architecture Infographic** (Feature 128) — New `/tachi.infographic --template executive-architecture` (alias: `exec`) generates a layered architecture diagram with Critical/High finding callouts, designed for CISO-level readers. In the compiled PDF security report the new page lands immediately after the Executive Summary (pages 2–3 area) so executives see the visual threat narrative within their first-glance window. Included in the `all` shorthand expansion alongside the existing five templates. Backward compatible — example PDFs without a generated `threat-executive-architecture.jpg` render byte-identical to the pre-F-128 baseline. Ships with tachi's first project-level pytest harness (`pyproject.toml`, `requirements-dev.txt`, `tests/`) and five committed `.baseline` PDFs guarding backward compatibility against silent regressions.
28
29
-**Architecture Lifecycle Command** (Feature 120) — `/tachi.architecture` now tracks versions with YAML frontmatter (version, date, description, SHA-256 checksum), archives previous versions to `.archive/v{N}/`, and supports guided updates through change categories. `/tachi.threat-model` automatically snapshots the architecture file into each timestamped output folder for full traceability. Backward compatible with existing architecture files.
**Problem**: Feature 128 shipped 2,139 lines of new Python (two extraction-script additions plus six test modules bootstrapping the pytest harness). The post-delivery `/aod.document` simplify review deleted 660 lines and rewrote 216 — a 31% reduction in changed-line count — with almost all of that coming from the test modules. The cleanup was dominated by three repeating anti-patterns: (1) module-level docstrings narrating the task-gating story ("Note on the test-first gate (T007)"), (2) per-function step-enumeration comments (`# Step 1:`, `# Step 2:`), and (3) inline references to task IDs (T023, T024, T029, T033) and review-artifact paths that will not make sense after the feature branch is merged.
559
+
560
+
**Root Cause**: Test generation during feature build captures the implementer's working-memory narrative — which tasks are gating which tests, which steps run in which order, which review findings shaped which assertion — and emits it as comments and docstrings. This information is useful *during* implementation (while the author is still holding the whole plan in their head) but becomes stale the moment the feature merges. The comments then linger as archaeological debris in the test modules, reducing signal density and creating misleading context for future maintainers.
561
+
562
+
**Solution**: Keep the `/aod.document` simplify step in the lifecycle as a mandatory cleanup gate, not an optional polish. The `/simplify` skill's three-agent review (reuse, quality, efficiency) reliably catches these patterns when pointed at the changed files. For F-128 the pass also caught a dead parameter, two duplicated closures, a hand-rolled severity dict that duplicated an imported constant, and 5× redundant subprocess runs in a parametrized test that collapsed cleanly into a module-scoped fixture.
563
+
564
+
**Result**: Production code became smaller, tighter, and free of task-reference artifacts. The pytest harness gained a `slow` marker registration enabling `pytest -m "not slow"` to run in ~5 seconds instead of ~20 (4× faster local iteration). Full suite still passes (39/39) and the smoke test against the agentic-app sample produces byte-identical output to the pre-refactor run.
565
+
566
+
**When to Apply**: Every feature that ships new test modules or non-trivial Python helpers. Expect a post-delivery simplify pass to remove 20–30% of changed-line count through comment and duplication cleanup alone. Allocate time for the `/aod.document` stage rather than treating it as optional.
0 commit comments