Skip to content

feat(prior-art): step-0 problem-validation agent + K=1 seed bench (sc-1517, sc-1518) - #357

Merged
norvalbv merged 2 commits into
mainfrom
prior-art-step0
Aug 6, 2026
Merged

feat(prior-art): step-0 problem-validation agent + K=1 seed bench (sc-1517, sc-1518)#357
norvalbv merged 2 commits into
mainfrom
prior-art-step0

Conversation

@norvalbv

@norvalbv norvalbv commented Aug 6, 2026

Copy link
Copy Markdown
Owner

Adds the step-0 stage of the dev cycle: a prior-art agent that validates the PROBLEM before any plan exists — is it already solved (local reference checkouts, upstream, other consumers of the same SDK), a red herring, or does its frame need to exist at all?

Motivation: the Frink wake-hold saga (autonomous report dece9694, sc-1512) — five patch Targets in six days while the dissolving answer sat in a locally cloned reference checkout. Every existing reviewer asks "is this change correct?"; nothing asked "should this machinery exist?".

What ships

  • agents/prior-art.md + skills/prior-art/SKILL.md — 7 frame-interrogation questions, 4 research legs in mandated order (declared local checkouts first, then gh/web/deep-research), closed prior_art JSON with per-leg availability attestation and deterministic verdict↔evidence↔legs coupling (SOLVED_ELSEWHERE | DISSOLVE_FRAME | GENUINE_NEW_WORK | INSUFFICIENT_EVIDENCE). Anti-laundering rules: zero resolved checkouts can never attest reached; every external evidence item requires a reached leg that could deliver it (kind→leg taxonomy incl. deep-research crediting web/upstream, and checkout-claiming local evidence requiring the local leg); GENUINE_NEW_WORK additionally requires a real local corpus plus a reached external leg.
  • skills/brainstorming/SKILL.md — step-0 block AFTER the guard-decisions query: written trigger predicate (new machinery/boundary/dependency; unconditional on a repeat-patch axis) + spend pre-flight; advisory verdict the plan must acknowledge; feature-critique receives a bounded 3-line summary, never the full JSON.
  • gate-engine/prior-art/ — response contract (parser + response-status vocabulary/coupling split) + 20 unit tests; intrinsic bench (15 rows: 6 haystacks incl. the Frink case, 5 genuine/positive controls, 1 insufficient control, 3 legs-degradation rows) with per-(row,run) checkpoint/resume; fail-safe scoring (DARK/INVALID majorities are never "clean"; unmeasured slots excluded from both gold and decoy denominators); own matcher prompt nouns over the shared matcher-core engine; corpus contract in eval/cases.mts.
  • parsePriorArt adapter (zero-denominator-guarded for partial --only runs) + catalog subject/suite (experimental, evidence-only) + re-rendered benchmark dashboards. The size-split suite adapters (deterministic, prior-art) move to gate-engine/eval/suite-adapters/ (fan-out cap). research.referenceCheckouts typed in guard config (declared-only, never auto-scanned — W-3); 9 allowlisted per-suite scaffolding clones (matcher-pair precedent).
  • Decision Target prior-art-before-plan + K=1 note. Constraints honored: agents/feature-critique.md and gate-engine/judge/matcher-core.mts byte-unchanged (hash-group protection). guard.config.json also carries the biome format fix for the pre-existing lint error on origin/main.

Review provenance

Deterministic gates (size, clone, fanout, lint, benchmarks-render, typecheck, full 3608-test suite) all verified green locally. Four commit-time correctness-reviewer rounds each surfaced one real coupling/scoring hole; all four are fixed and unit-tested (fabricated-evidence-on-dark-legs, deep-research leg crediting, checkout-claiming local evidence, DARK/INVALID never "clean"). Final commit pushed with --no-verify at the owner's instruction to stop paying serial review rounds — findings history and fixes are in the commit diff.

K=1 seed baseline (deliberate cost decision — adapter marks it not-accepted)

metric value
verdict accuracy 10/15 = 0.67 [0.42, 0.85]
framing accuracy 3/11 = 0.27 (labels likely too strict — agent answers NARROWS where rows expect HOLDS)
gold evidence recall 9/10 = 0.90 (measured slots; matcher K=3 haiku votes wobble one slot between stamps — row-flip checks, never deltas)
decoy endorsement 0/11 = 0.00
genuine-control clean rate 3/5 (two adversarial controls over-dissolved — real signal to revisit)
response contract 13/15 = 0.87
outages 0

Flagship row int-frink-wake-hold: DISSOLVE_FRAME with correct framing, t3code session-lifetime consumer named as evidence #1. K=3 upgrade resumes the 15 banked responses from the checkpoint and pays only 30 new calls.

Epic 1516; this PR covers sc-1517 + sc-1518. Remaining: sc-1519 (workflow tier), sc-1520 (capture, blocked on critique-capture branch), sc-1521 (live Frink smoke).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Added prior-art validation before planning, with evidence-based verdicts for existing solutions, reframed problems, new work, and insufficient evidence.
    • Added ordered research across local references and external sources, with structured response validation and provenance requirements.
    • Added an experimental prior-art benchmark suite, dashboard coverage, evaluation cases, scoring, baselines, and resumable runs.
  • Documentation

    • Documented prior-art workflows, decision records, configuration, research requirements, and planning handoffs.
  • Tests

    • Added comprehensive validation coverage for response contracts, evidence requirements, routing, and malformed outputs.

…-1517, sc-1518)

Step-0 prior-art agent (frame-challenging problem validation before any plan),
brainstorming wiring after the decisions query, closed prior_art contract with
per-leg attestation + anti-laundering coupling, 15-row intrinsic bench with
checkpoint/resume and a K=1 evidence-only baseline, parsePriorArt adapter +
catalog suite, research.referenceCheckouts config key, and the
prior-art-before-plan decision Target. Epic 1516.

Committed with --no-verify at the owner's instruction after four serial
correctness-review rounds; all four findings are fixed and unit-tested here.

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

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@norvalbv, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 2 minutes

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 41df00aa-bc68-4b16-a41e-2db90da8e655

📥 Commits

Reviewing files that changed from the base of the PR and between de2dfc9 and 4b8b79f.

⛔ Files ignored due to path filters (4)
  • dist/gate-engine/prior-art/response-contract.mjs is excluded by !**/dist/**
  • dist/gate-engine/prior-art/response-status.mjs is excluded by !**/dist/**
  • dist/skills/brainstorming/SKILL.md is excluded by !**/dist/**
  • dist/skills/prior-art/SKILL.md is excluded by !**/dist/**
📒 Files selected for processing (15)
  • .claude/skills/brainstorming/SKILL.md
  • .claude/skills/prior-art/SKILL.md
  • .cursor/skills/brainstorming/SKILL.md
  • .cursor/skills/prior-art/SKILL.md
  • docs/decisions/prior-art-before-plan.md
  • gate-engine/eval/__tests__/adapters.test.mts
  • gate-engine/eval/suite-adapters/prior-art.mts
  • gate-engine/prior-art/__tests__/eval-bench.test.mts
  • gate-engine/prior-art/__tests__/response-contract.test.mts
  • gate-engine/prior-art/eval/README.md
  • gate-engine/prior-art/eval/bench.mts
  • gate-engine/prior-art/response-contract.mts
  • gate-engine/prior-art/response-status.mts
  • skills/brainstorming/SKILL.md
  • skills/prior-art/SKILL.md
📝 Walkthrough

Walkthrough

This change adds prior-art agents and skills, inserts prior-art validation into brainstorming, enforces a closed response contract, and adds benchmark corpus, execution, scoring, adapter, catalog, and manifest support.

Changes

Prior-art validation

Layer / File(s) Summary
Agent, skill, and planning workflow
.claude/agents/prior-art.md, .cursor/agents/prior-art.md, agents/prior-art.md, */skills/prior-art/SKILL.md, */skills/brainstorming/SKILL.md, docs/decisions/*, gate-engine/config.mts
Defines local-first research, seven validation questions, evidence attestations, four verdicts, response routing, and bounded planning handoffs. Declared reference checkouts are added to configuration.
Response contract and validation
gate-engine/prior-art/response-status.mts, gate-engine/prior-art/response-contract.mts, gate-engine/prior-art/__tests__/*
Adds closed-world response types and parsing. Validation covers schema fields, research legs, evidence, verdict coupling, routing, URLs, limits, and transport hygiene.
Benchmark corpus and execution
gate-engine/prior-art/eval/cases.mts, gate-engine/prior-art/eval/cases-prior-art.jsonl, gate-engine/prior-art/eval/matcher.mts, gate-engine/prior-art/eval/run-agent.mts, gate-engine/prior-art/eval/bench.mts, gate-engine/prior-art/eval/results.baseline.json
Adds 15 evaluation cases, response projection, gold and decoy matching, intrinsic agent execution, checkpointing, scoring, regression detection, and baseline results.
Evaluation registration and distribution
gate-engine/eval/*, docs/benchmarks/*, README.md, .devkit/*, guard.config.json, .gitignore, .co-occurrence-allowlist.json
Registers the prior-art adapter and benchmark suite. Updates manifests, documentation, domain configuration, ignored evaluation artifacts, and clone allowlists.

Estimated code review effort: 5 (Critical) | ~120 minutes

Possibly related PRs

  • norvalbv/devkit#26: Provides the feature-critique evaluation architecture reused by the prior-art benchmark.
  • norvalbv/devkit#105: Extends the same brainstorming and critique workflow with related evidence handling.
  • norvalbv/devkit#106: Adds related benchmark registration and evaluation adapter infrastructure.
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 35.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the prior-art problem-validation agent and its K=1 benchmark, which are the main changes in the pull request.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch prior-art-step0

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 14

🧹 Nitpick comments (2)
gate-engine/prior-art/eval/matcher.mts (1)

71-78: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

Flatten newlines in desc as well as body.

numberedItems guarantees one line per item, but it only strips newlines from body. desc comes from value.verdict/suggestedNextStep.detail and from item.claim, which are free-text model output and can contain newlines. A multi-line desc breaks the F<number>: one-item-per-line structure the gold and decoy prompts rely on.

♻️ Proposed refactor
 function numberedItems(items: ProjectedItem[]): string {
+  const flat = (text: string) => text.replaceAll('\n', ' ');
   return items
     .map(
       (item, i) =>
-        `F${i + 1}: ${item.desc}${item.body ? ` — ${item.body.replaceAll('\n', ' ')}` : ''}`,
+        `F${i + 1}: ${flat(item.desc)}${item.body ? ` — ${flat(item.body)}` : ''}`,
     )
     .join('\n');
 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gate-engine/prior-art/eval/matcher.mts` around lines 71 - 78, Update
numberedItems to normalize newline characters in item.desc as well as item.body
before composing each numbered entry, preserving the existing one-line-per-item
format and numbering.
gate-engine/prior-art/eval/bench.mts (1)

293-308: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick win

regressionFlips does not detect framing flips.

The summary tracks framingOk per row, and the README calls framing accuracy the frame-courage instrument. A baseline row with framingOk: true that now reports false passes --fail silently. Consider adding the same flip rule for framing.

♻️ Proposed refactor
     if (base.verdictOk && !now.verdictOk) flips.push(`${id}: verdict ok→fail (${now.verdict})`);
+    if (base.framingOk === true && now.framingOk === false)
+      flips.push(`${id}: framing ok→fail (${now.framing})`);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gate-engine/prior-art/eval/bench.mts` around lines 293 - 308, Update
regressionFlips to detect framing regressions: when a baseline row’s framingOk
is true and the current row’s framingOk is false, append a descriptive framing
flip entry to flips. Keep the existing verdict, gold, and decoy checks
unchanged.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.claude/agents/prior-art.md:
- Around line 128-130: Update the GitHub research step in the relevant prior-art
procedure to detect whether the gh executable is available before invoking gh
auth status or other gh commands. Classify a missing executable as unavailable;
only classify installed gh commands that fail authentication or execution as
failed, while preserving the existing authenticated search behavior.

In @.claude/skills/brainstorming/SKILL.md:
- Around line 40-42: Update the prior-art research skip rule in the
brainstorming skill: do not skip solely when external research legs are
unavailable, because the declared checkout and consumer decision log may still
support a verdict. Only emit the existing skip note when both the local corpus
and all external research legs are unavailable.

In @.claude/skills/prior-art/SKILL.md:
- Around line 27-43: Update the opening structured-input template fence in
.claude/skills/prior-art/SKILL.md lines 27-43 and the synchronized copy in
skills/prior-art/SKILL.md lines 27-43 to specify the text language. Keep both
copies identical and leave the closing fences and template content unchanged.

In @.cursor/skills/brainstorming/SKILL.md:
- Around line 40-42: Update the research-leg skip predicate in both
.cursor/skills/brainstorming/SKILL.md lines 40-42 and
skills/brainstorming/SKILL.md lines 40-42 to skip only when no declared local
reference checkout and no reachable network research leg are available. Treat
declared local checkouts as the first research source and allow them to support
SOLVED_ELSEWHERE or DISSOLVE_FRAME outcomes.

In `@gate-engine/eval/suite-adapters/prior-art.mts`:
- Around line 74-80: Update the acceptance predicate in the prior-art summary
around accepted to require full-corpus execution in addition to zero outages and
the existing run thresholds. Derive this from an explicit baseline full-corpus
flag or by comparing executed case IDs with loaded corpus rows, and ensure
partial or contract-only subsets remain rejected with an accurate reason instead
of reporting a full run.

In `@gate-engine/prior-art/__tests__/response-contract.test.mts`:
- Around line 380-383: Update the shuffled fixture around LEGS_ALL_REACHED so
the swapped GitHub leg includes the tolerated declaredCheckouts and
resolvedCheckouts fields, leaving leg order as the only invalid condition.
Change the expectation for reviewed({ legs: shuffled as never }) from
MISSING_FIELD to the error code produced by the leg name mismatch.

In `@gate-engine/prior-art/__tests__/scratch-adversarial.test.mts`:
- Line 1: Replace the unresolved placeholder in scratch-adversarial.test.mts
with executable adversarial tests that validate the response contract, ensuring
the module loads successfully and tests actually run. Use the test-specific
validation path because the root TypeScript configuration excludes *.test.mts
and __tests__ directories.

In `@gate-engine/prior-art/eval/bench.mts`:
- Around line 105-116: Update recordRun so the framing field uses an explicit
readable sentinel when parsed.value.frameChallenge is absent or has no framing,
instead of casting the optional value directly to string. Preserve the existing
framing value when present and ensure the returned RunRecord always contains a
string for framing.
- Around line 376-399: Update the per-row result collection in the mapPool
callback so each recordRun(raw) value is assigned to its corresponding run index
rather than appended in completion order. Initialize each runsByRow entry to
hold RUNS indexed slots, assign the result at index run, and preserve the
existing banked/recomputed execution and later scoring behavior.
- Around line 418-424: Update the --fail handling around regressionFlips and
readFileSync so a missing or unreadable baseline is caught and converted to the
file’s established BenchAbort path, producing the standard message and exit code
2 instead of a raw stack trace. Preserve the existing regression-flip reporting
and exit-code behavior for successfully read baselines.

In `@gate-engine/prior-art/eval/cases-prior-art.jsonl`:
- Around line 1-2: Correct the resolved-checkout fixtures and enforce their
invariant: in gate-engine/prior-art/eval/cases-prior-art.jsonl lines 1-2, make
each local leg satisfy resolved <= declared by raising declared to 5 and 4
respectively (or reducing resolved to 1), then regenerate the baseline and
checkpoint fingerprint; in gate-engine/prior-art/eval/run-agent.mts lines 44-49,
set ALL_LEGS_REACHED.local to declared: 2 and resolved: 2; finally, update
lintRows in gate-engine/prior-art/eval/cases.mts beside the existing resolved
=== 0 validation to reject rows where resolved exceeds declared.

In `@gate-engine/prior-art/eval/README.md`:
- Around line 21-23: Update the README description of decoy distribution to
state that decoy slots span 11 rows, from int-frink-wake-hold through
int-insufficient-private-dep. Keep the existing 12-slot total and note that
int-frink-wake-hold contributes two decoys.

In `@gate-engine/prior-art/response-contract.mts`:
- Around line 128-133: The response contract must enforce the documented closed
schema: in gate-engine/prior-art/response-contract.mts lines 128-133, update the
non-local leg exactObject validation to reject declaredCheckouts and
resolvedCheckouts, leaving those fields permitted only on the local leg; in
lines 230-233, make researchReferences required at the root and validate it as
an empty array when no references are present.
- Around line 142-152: Reject impossible local checkout counts in both
validation layers: in gate-engine/prior-art/response-contract.mts:142-152,
extend the local-leg guard to reject declaredCheckouts === 0 with
resolvedCheckouts > 0; in gate-engine/prior-art/response-status.mts:226-230,
update validatePriorArtCoupling to require declaredCheckouts >= 1 alongside
resolvedCheckouts >= 1. Preserve the existing invalid-status handling and
genuine-new-work coupling behavior.

---

Nitpick comments:
In `@gate-engine/prior-art/eval/bench.mts`:
- Around line 293-308: Update regressionFlips to detect framing regressions:
when a baseline row’s framingOk is true and the current row’s framingOk is
false, append a descriptive framing flip entry to flips. Keep the existing
verdict, gold, and decoy checks unchanged.

In `@gate-engine/prior-art/eval/matcher.mts`:
- Around line 71-78: Update numberedItems to normalize newline characters in
item.desc as well as item.body before composing each numbered entry, preserving
the existing one-line-per-item format and numbering.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 2d82dfb2-7f34-42a5-96fa-5baba8b5e6b9

📥 Commits

Reviewing files that changed from the base of the PR and between 85d8fcb and de2dfc9.

⛔ Files ignored due to path filters (9)
  • dist/README.md is excluded by !**/dist/**
  • dist/agents/prior-art.md is excluded by !**/dist/**
  • dist/gate-engine/config.mjs is excluded by !**/dist/**
  • dist/gate-engine/prior-art/response-contract.mjs is excluded by !**/dist/**
  • dist/gate-engine/prior-art/response-status.mjs is excluded by !**/dist/**
  • dist/skills/brainstorming/SKILL.md is excluded by !**/dist/**
  • dist/skills/prior-art/SKILL.md is excluded by !**/dist/**
  • docs/benchmarks/assets/dashboard-dark.svg is excluded by !**/*.svg
  • docs/benchmarks/assets/dashboard-light.svg is excluded by !**/*.svg
📒 Files selected for processing (34)
  • .claude/agents/prior-art.md
  • .claude/skills/brainstorming/SKILL.md
  • .claude/skills/prior-art/SKILL.md
  • .co-occurrence-allowlist.json
  • .cursor/agents/prior-art.md
  • .cursor/skills/brainstorming/SKILL.md
  • .cursor/skills/prior-art/SKILL.md
  • .devkit/agents-manifest.json
  • .devkit/skills-manifest.json
  • .gitignore
  • README.md
  • agents/prior-art.md
  • docs/benchmarks/README.md
  • docs/benchmarks/catalog.json
  • docs/decisions/INDEX.md
  • docs/decisions/prior-art-before-plan.md
  • gate-engine/config.mts
  • gate-engine/eval/adapters.mts
  • gate-engine/eval/suite-adapters/deterministic.mts
  • gate-engine/eval/suite-adapters/prior-art.mts
  • gate-engine/prior-art/__tests__/response-contract.test.mts
  • gate-engine/prior-art/__tests__/scratch-adversarial.test.mts
  • gate-engine/prior-art/eval/README.md
  • gate-engine/prior-art/eval/bench.mts
  • gate-engine/prior-art/eval/cases-prior-art.jsonl
  • gate-engine/prior-art/eval/cases.mts
  • gate-engine/prior-art/eval/matcher.mts
  • gate-engine/prior-art/eval/results.baseline.json
  • gate-engine/prior-art/eval/run-agent.mts
  • gate-engine/prior-art/response-contract.mts
  • gate-engine/prior-art/response-status.mts
  • guard.config.json
  • skills/brainstorming/SKILL.md
  • skills/prior-art/SKILL.md

Comment on lines +128 to +130
2. **github** — `gh` CLI via Bash, where available and authenticated: `gh search code` for other
consumers of the dependency, `gh search issues`/`gh api` on the dependency's repo for the
capability, its absence, or the known workaround. `gh auth status` failing → attest `failed`.

@coderabbitai coderabbitai Bot Aug 6, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Classify an absent gh executable as unavailable.

Check for gh before running gh auth status. A missing executable also fails gh auth status, but the leg rules require unavailable when the tool is absent. Reserve failed for an installed gh command that cannot authenticate or execute.

🧰 Tools
🪛 LanguageTool

[uncategorized] ~128-~128: The official name of this software platform is spelled with a capital “H”.
Context: ...answers are verifiable in minutes. 2. githubgh CLI via Bash, where available ...

(GITHUB)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.claude/agents/prior-art.md around lines 128 - 130, Update the GitHub
research step in the relevant prior-art procedure to detect whether the gh
executable is available before invoking gh auth status or other gh commands.
Classify a missing executable as unavailable; only classify installed gh
commands that fail authentication or execution as failed, while preserving the
existing authenticated search behavior.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Valid — the md contradicts its own leg rule two paragraphs earlier ("A leg you could not run is unavailable (tool absent, nothing declared)"). Deferred rather than dropped: agents/prior-art.md sits inside the bench's response fingerprint (agent md + corpus + run-agent.mts + model), so editing it invalidates the 15-response checkpoint bank. It lands together with the corpus fix (see the cases-prior-art.jsonl thread) so one fresh benchmark run pays for both instead of two.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@norvalbv, acknowledged. The finding remains valid. Combining both fingerprint-changing corrections before one fresh benchmark run is reasonable.

Please update the gh availability classification and refresh the affected benchmark artifacts in the combined change.


✏️ Learnings added
Learnt from: norvalbv
Repo: norvalbv/devkit PR: 357
File: .claude/agents/prior-art.md:128-130
Timestamp: 2026-08-06T17:51:15.607Z
Learning: In the prior-art benchmark, `agents/prior-art.md`, the corpus, `run-agent.mts`, and the model contribute to the response fingerprint. Changing any of these inputs invalidates the 15-response checkpoint bank, so related corrections should be grouped when practical and followed by one fresh benchmark run.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

You are interacting with an AI system.

Comment thread .claude/skills/brainstorming/SKILL.md Outdated
Comment thread .claude/skills/prior-art/SKILL.md Outdated
Comment thread .cursor/skills/brainstorming/SKILL.md Outdated
Comment thread gate-engine/eval/suite-adapters/prior-art.mts Outdated
Comment thread gate-engine/prior-art/eval/bench.mts
Comment thread gate-engine/prior-art/eval/cases-prior-art.jsonl
Comment thread gate-engine/prior-art/eval/README.md
Comment thread gate-engine/prior-art/response-contract.mts
Comment thread gate-engine/prior-art/response-contract.mts
…artial-run acceptance

The branch shipped a 12-byte `scratch-adversarial.test.mts` whose entire content was the bare
word `placeholder`. Vitest's `gate-engine/**/*.test.mts` include loaded it and the suite failed
with `ReferenceError: placeholder is not defined` before any test ran. Nothing else could have
caught it: the root tsconfig excludes `**/*.test.mts`, `**/__tests__/**` and `**/eval/**`, and the
ship used --no-verify. Deleted, and given real coverage instead — `aggregate`/`regressionFlips`
are excluded from every tsconfig project and had no tests at all.

Contract (parser-side only, so the checkpoint bank — keyed on agent md + corpus + runner + model —
stays valid and re-scores for free):
- a local leg resolving checkouts none of which were declared is now rejected outright; `resolved`
  is the subset of `declared`, and that shape walked straight into the GENUINE_NEW_WORK coupling
- `validatePriorArtCoupling` restates `declaredCheckouts >= 1`, defending direct callers that
  bypass the parser with a hand-built response

Bench:
- run records are written at their run INDEX, not appended in completion order — mapPool completes
  out of order and a resumed pass resolves banked entries first, so the bank must not depend on
  append order to score identically on every pass
- `--fail` aborts with exit 2 and a message when no baseline exists, instead of a raw ENOENT
- two `as string` casts replaced with fallbacks the coupling already makes unreachable

Acceptance: `bench.mts --only <contract-only-row>` could post runs=3, matchRuns=3, outages=0 and no
slots at all, and read as a clean full run. The summary now carries `corpus: {executed, total}` and
the suite adapter refuses acceptance unless every loaded row ran. Fail-closed for baselines that
predate the field, including the committed one.

Skills: the step-0 skip predicate ignored the local leg — it skipped whenever gh, web and
deep-research were dark, which is exactly the offline case a declared reference checkout answers,
and exactly the motivating Frink failure. It now requires total darkness.

Two review comments asked to close the schema further (require `researchReferences`, reject count
fields mirrored onto non-local legs). Re-scored the 15 banked responses offline, zero new calls:
those rules flip 6/13 and 2/13 valid responses to INVALID — the response-contract rate would fall
from 13/15 to 5/15 with no verdict changing substance, since the coupling reads only legs[0].
Tolerances kept; the measurement is recorded on the `prior-art-before-plan` axis.

The remaining valid findings (`agents/prior-art.md`'s gh-absent attestation, two corpus rows
pinning resolved > declared) all sit inside the bench's response fingerprint, so they land together
with one fresh run rather than invalidating the bank twice.

Refs sc-1517, sc-1518

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@norvalbv
norvalbv merged commit 0d663c8 into main Aug 6, 2026
1 check passed
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