Skip to content

feat(skill-quality): fresh-eyes delegation doctrine + conformance gate (check 21)#1096

Open
kyle-sexton wants to merge 5 commits into
mainfrom
feat/fresh-eyes-delegation-doctrine-gate
Open

feat(skill-quality): fresh-eyes delegation doctrine + conformance gate (check 21)#1096
kyle-sexton wants to merge 5 commits into
mainfrom
feat/fresh-eyes-delegation-doctrine-gate

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Phase 1 of the fresh-eyes program (#304), per docs/topics/fresh-eyes-checkpoint-audit/PLAN.md:
the delegation-mechanics doctrine and its deterministic conformance gate land together, so every
Wave-2 retrofit PR that follows conforms to a merged spec.

  • docs/PLUGIN-PHILOSOPHY.md — new ## Delegation mechanics section beside the existing
    fresh-eyes section: dispatch ladder (generic fresh-context subagent with rich inline
    instructions = default; named agent behind the earned bar; cross-vendor advisor on top, always
    presence-gated with the generic fallback), inline-template conventions (fresh-context wording,
    artifact-not-story, degrade-when-absent), named-agent bar, model-tier ladder with a dated
    tier-to-model mapping and recheck trigger, tool-cage framing (Bash-holding allowlists are not
    read-only), and the two declared patterns with the skill-quality plugin as spec owner
    (convention-registry row added). Every load-bearing claim cites its official page, fetched and
    verified 2026-07-22 (six dated citations). Existing fresh-eyes section reconciled: "a named
    subagent removes it" → fresh-context (non-fork) subagent, generic or named.
  • check-skill.sh check 21 — fresh-eyes declaration conformance — implements the semantics
    table in docs/topics/fresh-eyes-checkpoint-audit/design/design-resolution.md verbatim:
    FAIL on malformed/unknown-class/reason-less fresh-eyes-exempt directives; WARN-only
    judgment-language heuristic (curated POSIX ERE, seeded from the audited skills' phrasing);
    stale-directive WARN (advisory); per-file line proximity (FRESH_EYES_PROXIMITY_LINES, tunable
    constant); fence- and inline-code-span-aware detectors (self-reference guard); CRLF-tolerant;
    scan surface = SKILL.md + skill-internal spoke dirs, vendor/ and evals/ excluded.
  • Consumer-facing specplugins/skill-quality/skills/check/reference/fresh-eyes-declarations.md
    carries the mechanical contract (grammar, classes, semantics table, curation policy); check-21
    messages point at it so third-party authors can read the rule without this repo's doctrine.
  • Test fixtures — 9 new cases (29–37): FAIL malformed / unknown class / missing reason; WARN
    undeclared judgment language / stale directive; PASS delegation prose (both spellings), valid
    exemption, fenced literals (self-reference guard), no judgment language.
  • Packaging — plugin 0.9.0 → 0.10.0, CHANGELOG entry, SKILL.md + plugin.json + root README
    descriptions "twenty" → "twenty-one"; also fixes pre-existing stale counts (plugin README still
    said "eighteen"/"seventeen" after checks 19–20 shipped; the checks list gained the missing
    injection-portability row).

Plan deltas (re-verified against current main per the plan's own freshness mandate)

  • Check number is 21, not 18/19 — two more checks shipped since the plan was authored.
  • The plan's item to correct docs/MIGRATION-PLAYBOOK.md:984 no longer applies: the current
    "seventeen" hit (line ~1115) is a dated 2026-07-13 decision record describing what the plugin
    shipped THEN — historical, true at its date, left intact.
  • The topic slice already sits on main via docs(topics): commit two uncommitted program Briefs for durability #776, so this PR does not re-carry it.
  • Fresh-docs re-fetch (plan work item 1) completed 2026-07-22 by a fresh-context agent: all seven
    doctrine claims verified against current official pages; no Brief constraint reopened. Notable
    current facts cited in the doctrine: frontmatter model defaults to inherit;
    CLAUDE_CODE_SUBAGENT_MODEL (model-config page) overrides both the per-invocation param and
    frontmatter; no per-plugin model seam in userConfig.

Verification

  • shellcheck clean on check-skill.sh; bash plugins/skill-quality/scripts/check-skill.test.sh
    exits 0 — 56 assertions including 10 new check-21 fixtures (fixture demo of the FAIL half: the
    malformed-directive fixture exits 1 naming the defect).
  • npx markdownlint-cli2 clean on every changed markdown file.
  • Independent fresh-context review before commit: 4 IMPORTANT findings, all fixed and
    empirically re-verified (consumer-facing spec path in messages; word-boundary guards on the
    judgment regex — "upgrade your own"/"underscore its own" no longer hit; CommonMark
    fence-matching so nested ~~~/ `` examples cannot desync the scanner; a fixture for the
    contradictory-declaration branch).
  • Fleet evidence (method delta from the plan, recorded in the memory slice): checks 1–20 are
    untouched and the suite proves no regression there, so the full-gate baseline diff is vacuous —
    the only possible gainers are check-21 emissions. The shipped check-21 scanner (extracted
    verbatim at runtime) ran over all 173 skills: 0 FAIL, 56 WARN sites in 24 skills, every
    site triaged and dispositioned (.work/fresh-eyes-checkpoint-audit/baselines/ check21-warn-triage-20260722.md): expected tranche-1/2 gainers ride Phases 2/4; the rest are
    hand-verified meta-text/quote/narrative hits; zero mechanical false hits, no regex change
    warranted. A clean full-gate pre-change baseline at the merge-base is retained alongside.
  • Doctrine section: ≥4 dated citations (actual: 6); registry row present.

Related

…e (check 21)

Phase 1 of program #304 per docs/topics/fresh-eyes-checkpoint-audit/PLAN.md:
PLUGIN-PHILOSOPHY gains the Delegation mechanics section (dispatch ladder,
named-agent bar, model tiers with dated mapping, declared patterns; all claims
cited to official pages verified 2026-07-22), and check-skill.sh gains check 21
enforcing the declared-pattern contract (FAIL on malformed/reason-less
fresh-eyes-exempt directives; WARN-only curated judgment-language heuristic;
fence- and span-aware; CommonMark fence matching; per-file proximity). The
mechanical spec ships inside the plugin for third-party authors
(skills/check/reference/fresh-eyes-declarations.md); registry row added.

Also fixes pre-existing stale check-count references (README still said
eighteen/seventeen after checks 19-20 shipped).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Automated review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

Re-running the job, or pushing a new commit, will retry the review.

@github-actions

github-actions Bot commented Jul 23, 2026

Copy link
Copy Markdown

Warning

Automated security review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

Re-running the job, or pushing a new commit, will retry the review.

@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: 8a7c6ab2e1

ℹ️ 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".

Comment thread plugins/skill-quality/scripts/check-skill.sh Outdated
Comment thread plugins/skill-quality/scripts/check-skill.sh Outdated
nd/nw/nj read as typo candidates (nd -> and); dir_n/word_n/judge_n say
what they count.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 3s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@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: 46c02c9601

ℹ️ 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".

Comment thread plugins/skill-quality/scripts/check-skill.sh Outdated
@kyle-sexton

Copy link
Copy Markdown
Contributor Author

🔒 babysit-prs lane claiming this PR for on-branch fix work this cycle (amendment-round: 16, safe tier). Will fix clear branch-owned findings and push; will not resolve threads or merge (safe tier).

Three review findings, each with a regression fixture:

- Fence closers follow CommonMark fully: an info-string line (```yaml)
  inside an open fence is content, never a closer.
- Inline code spans pair backtick runs of exactly equal length, so
  multi-backtick spans hide their content instead of being split at the
  first run.
- Delegation wording counts only when the line also names the worker or
  dispatch (agent|worker|advisor|reviewer|verif|dispatch|delegat) — bare
  "in a fresh context" prose assigns the judgment to no one.

Spec pages and the design contract amended to match (dated note).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 1s —— View job


I'll analyze this and get back to you.

@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: 7454583bd4

ℹ️ 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".

Comment thread plugins/skill-quality/scripts/check-skill.sh Outdated
Comment thread plugins/skill-quality/scripts/check-skill.sh Outdated
Two review findings, each with a regression fixture:

- Fence openers follow CommonMark indentation: at most three leading
  spaces; a four-space-indented backtick run is an indented code block,
  so a malformed directive after it is still scanned and still blocks.
- Worker token verif narrowed to verifier: the stem matched bare
  "verification" prose that dispatches no worker, so a same-context
  review line was misread as fresh-context delegation.

Spec page and the design contract amended to match (dated note).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@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: 84bb65834e

ℹ️ 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".

fe_char = substr(fe_run, 1, 1)
fe_len = 0
while (substr(fe_run, fe_len + 1, 1) == fe_char) fe_len++
if (!fe_fence) { fe_fence = 1; fe_open_char = fe_char; fe_open_len = fe_len }

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 Reject invalid backticks in a fence opener

For a backtick fence, CommonMark does not permit backticks in its info string. A line such as ```markdown ` is therefore ordinary prose, but this unconditional opener records it as a fence and suppresses all following content until a closing run. In particular, a subsequent malformed fresh-eyes-exempt directive is silently skipped and the checker reports PASS instead of its documented blocking directive error.

Useful? React with 👍 / 👎.

Comment on lines +830 to +831
if (low ~ /fresh[- ]context/ \
&& low ~ /agent|worker|advisor|reviewer|verifier|dispatch|delegat/) {

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 Require whole worker tokens in delegation matches

The worker check is a substring match, so non-worker prose can satisfy the delegation requirement. The fresh evidence is Self-review the work in a fresh context using an agentless workflow.: it produces the “fresh-context delegation declared nearby” INFO even though it explicitly names no worker or dispatch. Add token boundaries (and, ideally, word forms) around worker terms so this same-context review continues to warn.

Useful? React with 👍 / 👎.

@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: f7d1f4479b

ℹ️ 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".

Comment on lines +805 to +808
while (match(line, /`+/)) {
sp_start = RSTART; sp_len = RLENGTH
sp_rest = substr(line, sp_start + sp_len)
sp_close = 0; sp_base = 0; sp_search = sp_rest

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 Track inline code spans across line boundaries

When a literal directive example is inside a valid inline code span that crosses a newline, the opener is processed only in its first record and is not remembered for the next one, so the directive line reaches the parser and produces a blocking malformed-directive failure. For example, `<!-- fresh-eyes-exempt: bogus-class -- literal\nexample -->` fails despite being code-span content; retain delimiter state across input lines before applying the detectors.

Useful? React with 👍 / 👎.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@kyle-sexton kyle-sexton added the needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this. label Jul 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-human Human-in-the-loop required; autonomous sessions must not resolve items carrying this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant