Skip to content

fix(extract): archive-path source markers + knowledge new-file parity#10

Open
BeArchiTek wants to merge 1 commit into
mainfrom
fix/extract-archive-markers-and-knowledge-new-file
Open

fix(extract): archive-path source markers + knowledge new-file parity#10
BeArchiTek wants to merge 1 commit into
mainfrom
fix/extract-archive-markers-and-knowledge-new-file

Conversation

@BeArchiTek

@BeArchiTek BeArchiTek commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Two genuine bugs in the /extract command, surfaced during a downstream vendoring review in opsmill/infrahub-ansible#356. Both are cosmetic-to-minor and the change is minimal.

Fix A — archive-path source markers (commands/extract.md)

Phase 4 archives each processed spec to specs/archive/<spec-name>. The ADR section already writes its Source: marker against the archive path, and the Behavior Rules section codifies this ("ADR Source paths must reference the archive location ... since the spec will be moved there").

But the Knowledge updates and Guidelines updates sections wrote their source markers against the pre-archive path:

<!-- Extracted from specs/<spec-name> on YYYY-MM-DD -->

After extraction that path no longer exists, so every knowledge/guideline marker becomes a broken reference. This aligns both markers with the ADR rule:

<!-- Extracted from specs/archive/<spec-name> on YYYY-MM-DD -->

Fix B — Knowledge new-file creation parity (commands/extract.md)

The Guidelines updates section reads the target file "or create a new one if needed" and provides a new-file skeleton. The Knowledge updates section only said "Read the full target file" with no create-new-file branch — even though Phase 1 explicitly allows proposing brand-new knowledge files. A newly-approved knowledge file therefore had no creation instruction.

Added a parallel "or create a new one if needed" branch plus a skeleton consistent with the Guidelines pattern (using # <Topic> rather than # <Topic> Guidelines).

Fix C (minor, included) — prep Phase 5a threshold (commands/prep.md)

Phase 5a's "run the check" rule triggers on PRD-like input ">~400 chars", while the "skip" rule covers "one-line / vague / empty" — leaving a gray zone for substantive but sub-400-char unstructured descriptions. Added a one-line judgment qualifier to the skip rule so genuinely substantive short input is treated as a PRD under rule 2 rather than skipped. No restructuring.


Both extract fixes are low-risk: the markers are HTML comments, and the new-file branch is a parity/robustness gap rather than a behavioral break. Found via downstream review of the vendored speckit commands in opsmill/infrahub-ansible#356.

…+ add knowledge new-file branch

Phase 4 archives the spec to specs/archive/<spec-name>, but the knowledge
and guideline source markers still referenced specs/<spec-name>, leaving
broken references after extraction. Align them with the ADR rule.

Also add a "create a new one if needed" branch to the Knowledge updates
section for parity with Guidelines updates, so newly-approved knowledge
files (allowed in Phase 1) have a creation path.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant