Skip to content

refactor(planning): harden planning route and metadata guards - #81

Merged
c-wri merged 6 commits into
mainfrom
docs/standards-skill-hardening
Apr 19, 2026
Merged

refactor(planning): harden planning route and metadata guards#81
c-wri merged 6 commits into
mainfrom
docs/standards-skill-hardening

Conversation

@c-wri

@c-wri c-wri commented Apr 19, 2026

Copy link
Copy Markdown
Collaborator

Why:

  • planning-only repo work still lacked a full repo-local route, which left scope, verification, checkpointing, and compaction recovery under-specified for later agents
  • durable metadata policy around branch names, commit and PR text, and ordinary test surfaces needed tighter alignment between standards, validators, and review tooling

What:

  • add and harden the repo-local planning skill plus its mirrored metadata so planning work hands off cleanly to execution workflows
  • enforce branch-name and durable-metadata policy through the PR-review workflow, validators, hooks, and supporting tests
  • align the standards and command guidance with the enforced branch policy, spelled-out phase-label rejection, and synthetic-fixture allowance for validator and audit tests

Checks:

  • make pytest ARGS='-q tests/unit/test_commit_message_validator.py tests/unit/test_pr_metadata_validator.py tests/unit/test_pre_push_hook.py tests/unit/test_repo_agent_skills.py tests/unit/test_review_verification_executor.py tests/unit/test_run_pr_review_checks.py'
  • markdownlint docs/standards/commits.md
  • make pr-review-full

Issue linkage:

  • None: no existing open issue tracks this planning-route and durable-metadata hardening slice

Included checkpoints:

  • docs(standards): add durable metadata policy
  • docs(skills): add repo planning route
  • ci(metadata): enforce branch and metadata policy
  • test(policy): align engineering policy audit wording
  • fix(review): wire branch-aware local review checks
  • refactor(planning): harden planning route and metadata guards

@c-wri
c-wri marked this pull request as ready for review April 19, 2026 19:21
@c-wri
c-wri enabled auto-merge April 19, 2026 19:22
c-wri added 6 commits April 19, 2026 13:23
Why:
- durable control-plane and delivery surfaces needed an explicit durable
  metadata rule so planning tags stop leaking into standards, metadata, and
  branch naming
- ordinary work also needed a documented branch tree policy so branch roots
  stay reviewable and consistent

What:
- add the durable-versus-planning surface rule across the standards docs
- document the approved `<root>/<slug>` ordinary branch tree and durable
  delivery metadata rules
- route AGENTS and checkpoint or review commands through the updated policy

Checks:
- make docs-check
- make naming-check
Why:
- planning-only repo work needed a reusable entrypoint so agents stop
  inferring planning behavior from execution skills
- the touched workflow skills also needed explicit handoffs so broader planning
  work routes cleanly before execution starts

What:
- add the general repo-local `planning` skill and its UI metadata
- update docs, implementation, and PR review skills to hand planning-only work
  to that route
- extend the repo skill tests to cover the new planning skill and handoff text

Checks:
- make pytest ARGS='--no-cov -q tests/unit/test_repo_agent_skills.py'
Why:
- the durable branch and delivery metadata rules were only documented, so
  invalid branch names and planning tags could still slip through local hooks
  and PR checks
- the review runner also needed branch-name context so the existing
  `pr-metadata` status could enforce the full policy without adding a new
  check

What:
- add shared branch-root and durable-metadata validation in the message
  standards helpers plus commit and PR validators
- validate branch names before PR lookup in the pre-push hook and thread the
  current branch through review execution and PR workflow plumbing
- extend the targeted validator, hook, executor, and workflow tests

Checks:
- make pytest ARGS='--no-cov -q tests/unit/test_pr_metadata_validator.py'
- make pytest ARGS='--no-cov -q tests/unit/test_commit_message_validator.py'
- make pytest ARGS='--no-cov -q tests/unit/test_pre_push_hook.py'
- make pytest ARGS='--no-cov -q tests/unit/test_review_verification_executor.py'
- make pytest ARGS='--no-cov -q tests/unit/test_review_verification_workflows.py'
Why:
- docs-audit still expected the older broad forward-target wording and would
  drift from the updated engineering standard
- the repo needed that alignment without widening pytest ownership over live
  docs policy

What:
- narrow the engineering policy-alignment expectation to the updated
  planning-versus-durable wording
- keep the docs-audit change scoped to the existing policy-alignment rule

Checks:
- make pytest ARGS='--no-cov -q tests/unit/test_docs_audit.py'
- make pytest ARGS='--no-cov -q tests/contract/test_standards_guards.py'
Why:
- the local PR review runner accepted PR title and body overrides but did not carry a branch-name override into the review context, so the new branch validation path was not fully wired outside the GitHub workflow
- direct make pytest subset runs also inherited the global coverage gate, which made narrow local reruns fail even though coverage enforcement already belongs to the quality and PR-review runners

What:
- add --branch-name support to tools.run_pr_review_checks and pass it into the review execution context
- make the direct pytest Make target default to --no-cov, update the commit standard example, and align the docs-audit policy check with that direct-runner behavior
- add regression coverage for the branch-name override path and pin the Makefile no-cov default in the standards guard suite

Checks:
- make docs-audit
- make pytest ARGS='-q tests/unit/test_run_pr_review_checks.py tests/contract/test_standards_guards.py'
- make pytest ARGS='--no-cov -q tests/contract/test_standards_guards.py tests/unit/test_run_pr_review_checks.py tests/unit/test_review_verification_executor.py tests/unit/test_review_verification_workflows.py tests/unit/test_pre_push_hook.py tests/unit/test_pr_metadata_validator.py'
- make pr-review
Why:
- the general planning route still read like a thin redirect, which left
  planning-specific standards under-specified for later agents after compaction
- durable metadata validation still allowed spelled-out planning labels through,
  the test-surface rule conflicted with allowed synthetic validator fixtures,
  and the commit standards branch note contradicted the enforced branch policy

What:
- reshape the repo's general `planning` skill and its metadata to match the
  existing workflow-skill depth while carrying scope, verification,
  checkpoints, assumptions, and compaction recovery
- extend durable metadata validation and the existing metadata suites so
  spelled-out planning labels are rejected on branch, commit, and PR metadata
- align `AGENTS.md`, `docs/standards/implementation.md`, and
  `docs/standards/commits.md` with the durable metadata and branch-policy
  wording while still allowing synthetic validator and audit fixtures on
  synthetic inputs
- strengthen the existing skill and metadata tests rather than adding a new
  enforcement surface

Checks:
- make pytest ARGS='-q tests/unit/test_commit_message_validator.py tests/unit/test_pr_metadata_validator.py tests/unit/test_pre_push_hook.py tests/unit/test_repo_agent_skills.py tests/unit/test_review_verification_executor.py tests/unit/test_run_pr_review_checks.py'
- markdownlint docs/standards/commits.md
- make pr-review-full
@c-wri
c-wri force-pushed the docs/standards-skill-hardening branch from edf2c2b to 7096140 Compare April 19, 2026 19:24
@c-wri
c-wri merged commit 04f38c5 into main Apr 19, 2026
28 checks passed
@c-wri
c-wri deleted the docs/standards-skill-hardening branch April 19, 2026 19:26
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