Skip to content

feat(governance): complete traceability gate depth checks - #178

Open
bouillipx wants to merge 2 commits into
mainfrom
codex/enhance-doc-governance-traceability
Open

feat(governance): complete traceability gate depth checks#178
bouillipx wants to merge 2 commits into
mainfrom
codex/enhance-doc-governance-traceability

Conversation

@bouillipx

Copy link
Copy Markdown
Collaborator

Summary

This PR completes the remaining implementation work for enhance-doc-governance-traceability task group 3.2-3.4.

It extends the governance traceability gate to:

  • enforce required frontmatter on the baseline governance standard/design/TODO documents
  • require active feature docs with todo_ids to be covered by a ## TODO Coverage section in their OpenSpec tasks artifact
  • reverse-resolve Claim Ledger / slice-plan targets back to concrete feature docs and tasks artifacts

Why

PR #175 established the baseline governance traceability gate and hardened the initial index / claim matching contract.

The remaining gap was depth coverage:

  • frontmatter enforcement was not yet machine-checked for the baseline governance standard/design/TODO records
  • active feature docs could declare todo_ids without a corresponding tasks-level coverage section
  • master TODO slice mappings could drift away from concrete feature/tasks targets without failing CI

This PR closes those gaps and leaves only 5.3 (closeout/archive) pending after merge.

Scope

Included:

  • scripts/ci/check_governance_traceability.sh
  • tests/unit/test_governance_traceability_gate.py
  • governance baseline doc frontmatter backfill under docs/governance/, docs/guides/, docs/design/, and docs/todos/
  • pilot tasks coverage backfill in openspec/changes/agentscope-d2-d4-thinking-transport/tasks.md
  • OpenSpec task/evidence sync for enhance-doc-governance-traceability

Not included:

  • change archive / closeout (5.3)
  • new runtime behavior
  • branch-protection admin work for p0-conformance-gate

TODO / Change Mapping

  • Change: enhance-doc-governance-traceability
  • Tasks completed in this PR:
    • 3.2
    • 3.3
    • 3.4
  • Remaining task after merge:
    • 5.3

Validation

Executed on the rebased branch after syncing to latest origin/main:

  • ../../.venv/bin/python -m pytest -q tests/unit/test_governance_traceability_gate.py tests/unit/test_governance_evidence_truth_gate.py -> 53 passed
  • ./scripts/ci/check_governance_traceability.sh -> passed
  • ./scripts/ci/check_governance_evidence_truth.sh -> passed
  • openspec validate enhance-doc-governance-traceability --type change --strict --json --no-interactive -> valid=true

Review Focus

Please focus review on:

  • frontmatter scope selection for governance-tracked baseline docs
  • ## TODO Coverage resolution rules for active features with todo_ids
  • Claim Ledger / slice-plan reverse mapping logic, especially the planned-claim exclusion semantics

Finish tasks 3.2-3.4 for enhance-doc-governance-traceability by extending the governance traceability gate beyond feature index integrity.

Key changes:
- enforce required frontmatter on the governance baseline standard/design docs and all concrete TODO ledger records under docs/todos
- require active feature docs with todo_ids to map those ids through a tasks artifact TODO Coverage section
- validate master TODO and slice-planning change targets resolve back to concrete feature docs and tasks artifacts, while skipping planned placeholder claims
- add red/green regressions for frontmatter enforcement, task coverage, reverse TODO mapping, and archive-path edge cases
- backfill the affected governance and TODO docs with canonical frontmatter and add TODO Coverage to the agentscope D2/D4 pilot tasks file
- sync OpenSpec task status and feature evidence so the change now sits at 21/22 tasks complete

Rationale:
The previous slice left three governance gaps open: non-feature docs were not machine-checked for frontmatter, TODO-linked feature slices were not forced to declare their task coverage, and master TODO ledgers could drift away from actual change artifacts in the reverse direction. This commit closes those gaps with deterministic shell checks and fixture-backed regressions without widening scope to unrelated runtime behavior.

Verification:
- ../../.venv/bin/python -m pytest -q tests/unit/test_governance_traceability_gate.py tests/unit/test_governance_evidence_truth_gate.py
- ./scripts/ci/check_governance_traceability.sh
- ./scripts/ci/check_governance_evidence_truth.sh
- openspec validate enhance-doc-governance-traceability --type change --strict --json --no-interactive
- openspec list
…hecks

Record the new implementation PR for the post-#175 traceability gate depth work in the active feature aggregation document.

Key changes:
- relabel earlier governance PRs as baseline/previous implementation references
- point the current implementation PR link at #178
- preserve the active feature doc as the review and merge-gate source of truth

Rationale:
The branch was rebased onto the latest main before opening the new implementation PR. The feature aggregation document must reflect the current review surface so governance evidence and merge-gate history remain accurate and machine-checkable.

Verification:
- ./scripts/ci/check_governance_traceability.sh
- ./scripts/ci/check_governance_evidence_truth.sh
- openspec validate enhance-doc-governance-traceability --type change --strict --json --no-interactive

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2eaeaa2985

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

docs/guides/Documentation_First_Development_SOP.md \
docs/guides/Development_Constraints.md \
docs/guides/Evidence_Truth_Implementation_Strategy.md; do
[[ -f "$file" ]] && check_governance_doc_frontmatter "$file" "standard"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Fail when baseline governance docs are missing

check_governance_tracked_frontmatter only validates baseline standard/design docs when they already exist, so removing a required governance file (for example docs/guides/Development_Constraints.md) still lets the gate pass. I verified this by running the script against this commit with that file deleted and it returned success, which means CI no longer protects the required governance corpus from accidental deletion and traceability can silently regress.

Useful? React with 👍 / 👎.

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