Skip to content

docs(routing): prefer enforcement over prose, and make harness-artefact materializable - #44

Merged
CybotTM merged 4 commits into
mainfrom
feat/retro-mechanical-first
Jul 25, 2026
Merged

docs(routing): prefer enforcement over prose, and make harness-artefact materializable#44
CybotTM merged 4 commits into
mainfrom
feat/retro-mechanical-first

Conversation

@CybotTM

@CybotTM CybotTM commented Jul 25, 2026

Copy link
Copy Markdown
Member

Problem

classification-heuristic.md and destination-taxonomy.md both state the routing bias as a single ranked ladder: skill-update/new-skillproject-ruleuser-memory. The two mechanical destinations — checkpoint (5) and harness-artefact (6) — are absent from that ladder. They appear only in a "choosing between adjacent destinations" tiebreaker table, which is then overridden three lines later by "bias upward in reach".

Effect: a finding that a pre-commit hook, a CI job, or a linter rule could have caught gets routed to a paragraph in a skill, which the model can still ignore. Nothing in the skill states that a gate outranks a sentence.

Two further gaps surfaced while fixing that, and are fixed here as well: destination 6 had no materialization mechanics at all, and no eval asserted the mechanical routing.

Changes

1. Routing becomes two-dimensional (ae6b0bf)

  1. Enforceability — mechanical gate (checkpoint mechanical: / harness-artefact) › LLM review (checkpoint llm_reviews:) › prose (skill-update / project-rule / user-memory).
  2. Reach — the existing ladder, applied to whatever legitimately stays prose.

The enforcement ordering is not invented here. agent-harness-skill/references/enforcement-mechanisms.md already ranks the ten instruments server-side → convention-based and states the CI/hook parity rule ("when CI catches a mechanical issue that a hook could have caught, the absence of the hook is the bug"). This imports and cites it.

Guard against over-correction: most B16–B18 reusable learnings are judgment-shaped and belong in tier 3. The test is whether a check could have failed on the friction as it actually occurred — not whether a regex could be written after the fact.

harness-artefact also gains two artefact types that were materializable but unlisted: linter/static-analysis rules (ships where the analyzer already runs) and branch protection/rulesets.

2. Materialization mechanics for destination 6 (d7996d2)

Destination 6 was a seven-line delegation stub — an artefact list plus "invokes agent-harness-skill bootstrap". patch-workflow.md covered only skill source repos, so a harness-artefact proposal had no target-repo selection and no rule against clobbering an existing hook config. Five differences are now specified:

  • target selection — a worktree off the (usually dirty) session repo, never a stash
  • verify-before-bootstrap against the AH-* checkpoint globs; extend the existing artefact, never overwrite it
  • CI/hook parity in the same PR — a CI fast-check without the matching hook is half-materialized
  • server-side instruments (branch protection, rulesets) are an API call, not a patch: emit the command, report manual, never apply silently
  • analyzer-config edits preferred where the analyzer is already wired in

3. Paired materialization (6ef32c7)

The axes genuinely conflict — a gate lands in one repo, a skill-update reaches every repo the skill touches. Resolved as a bounded exception to "every finding maps to exactly one destination":

Part Destination Content
Gate harness-artefact / checkpoint the check, in the repo the friction happened in
Propagation skill-update the recipe for installing that gate, in the owning skill

One proposal, one approval, one slot against the ≤10 cap, two reported rows (4a/4b) so a half-failed pair stays visible. Two parts maximum. The propagation half carries installation instructions, never a restatement of the rule the gate enforces — if the prose still makes sense with the gate deleted, it is a restatement and gets dropped.

Splitting a pair into two proposals was the alternative and is rejected: it allows the prose half to be approved while the gate half is rejected, reproducing the exact failure this PR fixes.

4. Positive eval (bdb8c52)

evals/harness-artefact-over-prose.md — the A17 shape where CI catches in 90s what a hook catches in 2s. Asserts the gate routing, extending the hollow hook config rather than replacing it, and that the reach ladder does not claim the finding first. Previously the only eval naming harness-artefact was a negative case.

Verification

  • pre-commit run --files <changed> — markdownlint passed on all five files
  • python3 -m pytest tests/ -q — 76 passed
  • validate-evals.py --evals-dir skills/retro/evals — 10 scenarios well-formed (was 9)
  • cross-references checked: every "Paired materialization", "Harness artefacts" and "Routing — enforceability first, then reach" citation resolves to an existing ## heading

SKILL.md is untouched — it sits at 491 words against the 500 cap, so the new material lives in the references the classify phase already reads.

The scope-escalation ladder ranked only the three prose destinations
(skill-update / project-rule / user-memory), so a mechanically enforceable
finding was pulled toward "add a paragraph to a skill" by the loudest rule in
the skill. checkpoint and harness-artefact appeared only as a tiebreaker table.

Make routing two-dimensional: axis 1 asks whether the rule can be enforced
(mechanical gate > llm_reviews > prose), axis 2 applies the existing reach
ladder to whatever stays prose. The enforcement ordering is not invented here —
it cites agent-harness-skill's enforcement-mechanisms.md, which already ranks
the ten instruments and states the CI/hook parity rule.

Also name the axes' conflict explicitly (a gate reaches one repo, a skill
reaches all of them) and resolve it: the prose beside a gate is the recipe for
installing that gate elsewhere, not a restatement of the rule.

Add linter/analyzer rules and branch protection to the harness-artefact
artefact list; both were materializable but unlisted.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
Copilot AI review requested due to automatic review settings July 25, 2026 14:59

Copilot AI 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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

CybotTM added 3 commits July 25, 2026 17:09
Destination 6 was a seven-line delegation stub: an artefact list plus "invokes
agent-harness-skill bootstrap". patch-workflow.md covered only skill source
repos, so a harness-artefact proposal had no target-repo selection, no rule
against overwriting an existing hook config, and no handling for instruments
that are an API call rather than a file.

Five differences from the skill-repo case are now specified: target selection
(worktree off the dirty session repo), verify-before-bootstrap against the
AH-* checkpoints, CI/hook parity in the same PR, server-side rules emitted as a
command for the user instead of a patch, and analyzer-config edits preferred
where the analyzer already runs.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
The only eval naming harness-artefact was a negative case (a transient tool
error that must not become a gate). Nothing asserted that a mechanically
preventable friction routes to a gate rather than to a prose rule, so the
enforceability axis had no regression target.

Covers the A17 shape where CI catches what a hook could have: extend the
existing hook config, do not restate the rule in CLAUDE.md, and do not let the
reach ladder claim the finding first.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
The enforceability axis creates a case the "exactly one destination" contract
could not express: a gate belongs in the repo the friction happened in, and the
recipe for installing it belongs in the skill that owns the topic. Left
unresolved, that either loses the propagation or splits into two proposals whose
prose half can be approved while the gate half is rejected.

A pair is one proposal, one approval, one slot against the ≤10 cap, and two
reported rows (4a/4b) so a half-failed pair stays visible. Bounded at two parts;
the propagation half carries installation, never a restatement of the rule.

Also report server-side instruments as `manual` — they are an API call, not a
patch, and retro never applies them.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@sonarqubecloud

Copy link
Copy Markdown

@CybotTM CybotTM changed the title docs(classification): route by enforceability before reach docs(routing): prefer enforcement over prose, and make harness-artefact materializable Jul 25, 2026
@CybotTM
CybotTM merged commit 403ef94 into main Jul 25, 2026
10 checks passed
@CybotTM
CybotTM deleted the feat/retro-mechanical-first branch July 25, 2026 15:13
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.

2 participants