Skip to content

build: fast agent feedback loop (xtask check/lint/smoke, nextest, qq-mode skills) (ENG-1028) - #282

Merged
lg2m merged 23 commits into
mainfrom
build/eng-1028-agent-feedback-loop
Oct 15, 2026
Merged

lg2m merged 23 commits into
mainfrom
build/eng-1028-agent-feedback-loop

Conversation

@lg2m

@lg2m lg2m commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

What this gives agents (and humans)

A fast, legible feedback loop and an exact workflow, so an agent can change qq, see immediately what broke, and prove what works. Inspired by poteto's pstack: a mode skill routing to playbooks, principle skills, a project verification skill with a feature map, and lessons encoded as tools instead of prose.

Command What it does Time here
cargo xtask check fmt, lint, clippy, and nextest on only the packages the diff can affect (owner plus reverse deps, dev edges included; root inputs select everything). Writes target/qq-check/last.json with each failing test, its panic, and the exact rerun command qq-tui change 46 s; full scope 53 s
cargo xtask smoke 6 scenarios drive the real qq binary (ask, run with a tool call, provider 401, session resume, serve + SSE reconnect, doctor/config) against an in-process loopback fake. Failures keep stdout/stderr, every provider request, and the store 0.5 s after build
cargo xtask lint repo rules Clippy can't see: no mod.rs, forbid(unsafe_code), reasoned #[ignore], no unbounded channels in production, ADR index rows, fixed sleeps in tests ratcheted at 70 (ceiling must equal the count) <1 s
cargo xtask check --evidence Markdown proof for a PR body; refuses a report for another commit or tree state

CI: PRs run the affected gate plus smoke; merge_group, main, and manual runs run check --full, the embed and minimal-core profiles, wasm32, and Windows. The ci:full label runs the platform jobs on a PR. Superseded PR runs are cancelled. Failed runs upload the report, JUnit, and smoke evidence.

Operator action needed: enable the merge queue in branch protection and require checks, client-wasm, windows-teardown. Until then the full gate only runs post-merge on main (documented in AGENTS.md and docs/runbooks/testing.md).

Agent instructions: AGENTS.md becomes a router (start with qq-mode, the loop in four commands, a Rules → enforcers table). Skills in .qq/skills (also .agents/skills for other harnesses):

  • qq-mode: non-negotiables, autonomy limits, 13 playbooks (bug fix, feature, refactoring, perf, test audit, investigation, slice, review, babysit, session pickup, correct, opening a PR) plus routing rows for protocol, TUI, docs-only, CI/xtask, dependency, and release work.
  • principles: the engineering principles the playbooks cite.
  • verify-qq: qq-home.sh (isolated home plus a scripted fake provider) and a feature map for ask, run, serve, TUI, sessions, tools/approvals, delegation, compaction, MCP, and config/doctor. Replaces qq-verify.

Build speed (AF0 baseline → now, loaded 32-core host)

Before After
cargo test --workspace warm 140 s n/a (nextest 38–81 s)
docs-only edit, rebuild tests 4.5 s (relinked qq) 0.14 s
root src/ edit, rebuild tests 6.4 s 1.9 s
target/debug/qq 595 MB 189 MB

Changes: [profile.dev] debug = "line-tables-only", no debuginfo for deps; build.rs watches every tracked file only for release builds (or QQ_EXACT_REVISION=1). A dev binary's -dirty flag can lag until the next commit; release builds stay exact.

Design decisions

  • Nothing fake ships in qq: the smoke fake lives in xtask, the verify fake in a skill script.
  • Affected selection is conservative: root manifests, toolchain, .cargo/, .config/, and nix/ select the full workspace; known cross-crate test inputs (docs/guide, README, fixtures) are mapped explicitly. A missing merge-base is an error, never a working-tree-only check. Feature-unification differences between -p subsets and --workspace are caught by the merge-queue gate.
  • Reports and smoke/verify homes stay in each checkout's own target/, even with a shared CARGO_TARGET_DIR, so parallel agents never read each other's results.

How verified

cargo xtask check

Head 3a66f8dc217c vs origin/main; 55 changed file(s); scope: full workspace.

Gate Result Tests Time Command
fmt pass 1.3s cargo fmt --all -- --check
lint pass 0.7s cargo xtask lint
clippy pass 2.2s cargo clippy --color never --workspace --all-targets --all-features -- -D warnings
test pass 2242/2242 passed, 14 skipped 29.4s cargo nextest run --color never --profile default --workspace
doctest pass 1.4s cargo test --color never --workspace --doc
minimal-clippy pass 0.1s cargo clippy --color never -p qq-provider --no-default-features --features test-support --all-targets -- -D warnings
minimal-test pass 211/211 passed, 0 skipped 1.1s cargo nextest run --color never --profile default -p qq-provider --no-default-features --features test-support

All gates passed in 36.3s.

  • Injected bug (empty tool result in the OpenAI adapter): run-tool-call failed and kept the provider requests as evidence. Reverted.
  • Injected failing test: the report and --evidence named the test, the panic (render.rs:429:9, left/right), and the rerun command.
  • Broken SSE resume cursor: serve-sse failed with "resume replayed sequence 1, at or before the cursor 11".
  • nextest parser tested against real 0.9.140 output (default and ci profiles: fail, abort, timeout, flaky).
  • verify-qq drives run end to end: tools/approvals (denied vs completed), delegation (child session events), sessions/resume, serve via curl, and the TUI via script.
  • Two independent reviews (code; cold-start docs usability). All blocking and should-fix findings were addressed in 261af47.

Not done here (planned in docs/plans/agent-feedback.md)

  • AF5 QQ_LOG structured tracing (needs an ADR).
  • AF6 test audit per module (flake stress, removing sleeps, cargo-mutants, merging duplicate tests). First candidate: qq-core sessions::tests::deadlines::duration_cancels_read_only_and_mutating_external_calls failed once under load and passed 65/65 under stress.
  • AF10 blinded eval of the skills against the old AGENTS.md.

Linear: ENG-1028

lg2m added 8 commits October 11, 2026 22:27
- cargo xtask check: affected-only fmt/lint/clippy/nextest from the git
  diff and the workspace dependency graph; --full is the merge gate;
  writes target/qq-check/last.json and --evidence for PR bodies
- cargo xtask lint: no mod.rs, forbid(unsafe_code), reasoned #[ignore],
  no unbounded channels in production, ADR index rows, and a ceiling
  on fixed sleeps in tests that only moves down
- cargo xtask smoke: six scenarios drive the real qq binary (ask, run
  with a tool call, provider 401, session resume, serve over SSE,
  doctor/config) against a loopback fake Responses endpoint
- .config/nextest.toml: default/quick/ci profiles; long qq-core
  session suites start first
- dev profile: line-tables-only debuginfo, none for deps (qq debug
  binary 595 MB -> 189 MB)
- build.rs: watch every tracked file only for release builds or
  QQ_EXACT_REVISION=1; docs edits no longer relink qq
…-1028)

Pull requests run cargo xtask check against the base branch merge-base
plus smoke; merge_group, main, and manual runs run check --full, the
embedding and minimal-core profiles, wasm32, and Windows teardown. A
ci:full label runs the platform jobs on a pull request. Superseded PR
runs are cancelled. Failed runs upload target/qq-check, JUnit, and smoke
evidence.

Adds .githooks/pre-push (cargo xtask check --profile quick).
…ack loop (ENG-1028)

AGENTS.md becomes a router: start with the qq-mode skill, use the
cargo xtask check/smoke loop, read target/qq-check/last.json on failure.
Repository facts and style rules stay; a Rules -> enforcers table names
the tool that checks each rule.

Skills (.qq/skills, also .agents/skills for other harnesses):
- qq-mode: non-negotiables, autonomy limits, and eleven playbooks
  (bug fix, feature, refactoring, perf, test audit, investigation, slice,
  babysit, session pickup, correct, opening a PR)
- principles: the engineering principles qq-mode cites
- verify-qq: isolated home plus scripted fake provider (qq-home.sh) and a
  feature map for ask, run, serve, TUI, sessions, tools/approvals,
  delegation, compaction, MCP, and config/doctor; replaces qq-verify

docs/runbooks/testing.md documents the loop, failure reports, test
policy, nextest profiles, and CI; local-dev, workflow, and the slice
template point at it.
check:
- refuse when the merge-base is missing instead of checking only the
  working tree (a clean tree passed untested commits)
- diff with --no-renames; README/CHANGELOG reach the root docs_truth
  tests, docs/guide reaches xtask release tests, build.rs maps to qq
- any qq-provider change runs the minimal profile, now Clippy and tests
- parse real nextest 0.9.140 output: --color never, TRY n retries,
  ABRT/TMT/SIG*, timed-out and aborted messages; record test counts;
  fixtures under xtask/tests/fixtures
- stream gate output to the log file; run lint in-process; add a doctest
  gate to full scope; reports live in the checkout's own target/
- --evidence refuses a report for another commit or tree state; a run
  deletes the previous report first; hint when the pre-push hook is off

lint:
- only inline #[cfg(test)] mod { } blocks are test code (brace depth);
  out-of-line mod tests; no longer exempts the rest of the file
- strings, raw strings, and char literals never match rules
- the sleep ceiling must equal the count (70), so it only moves down

smoke:
- serve logs to files; resume is proven by a second run after
  reconnecting; per-invocation evidence; doctor exit checked; private
  binary copy; blocking setup off the runtime

verify-qq: the fake restarts its script when script.jsonl changes;
qq-home.sh refuses a live home, execs qq, honours QQ_CONTEXT_WINDOW;
serve, TUI, and tools drives verified and corrected.

Docs: restore AGENTS.md rules lost in the rewrite (Executor MCP, git
status first, non-interactive, branch without an issue, architecture
caveat, ledger every session, bounded blocking); one regression-test
rule; review playbook and rows for protocol, TUI, docs-only, CI/xtask,
dependency and release work; repo-relative playbook paths; name: in
every SKILL.md; .worktrees/ ignored.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-15T05:51:24.559621Z b9e0bfc Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 3a66f8dc21

ℹ️ 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 .config/nextest.toml Resolved
Comment thread xtask/src/check.rs Resolved
Comment thread xtask/src/check.rs Resolved
Comment thread xtask/src/lint.rs Resolved
Comment thread xtask/src/lint.rs Resolved
Comment thread xtask/src/smoke.rs Resolved
Comment thread xtask/src/smoke.rs Resolved
Comment thread xtask/src/lint.rs Resolved
Comment thread .qq/skills/verify-qq/qq-home.sh Resolved
Comment thread .agents/skills Resolved
@lg2m

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Review fixes pushed in 293f458 (fast-forward, no shared branch rewrite); current main merged and AGENTS conflict resolved. All 15 findings addressed: flaky CI fails; SHA-256 index/working/untracked snapshot binds evidence; --full bypasses merge-base; Windows package and executable paths; compound cfg and test-function linting; code-only forbid; crossbeam/std unbounded detection; actual ADR links; async provider logging; stronger 401/resume assertions; duplicate --only deduplication; process identity + pidfd cleanup; ordinary .agents compatibility files. Independent review also found/fixed missing docs_truth mappings for architecture and run-output-queries.

Verification at 293f458: cargo xtask check --full --profile ci passed: fmt/lint/Clippy; 2439/2439 tests (14 skipped); doctests; minimal provider Clippy and 211/211 tests, 146.1s. cargo xtask smoke 6/6; cargo build --workspace passed; xtask focused 95/95; duplicate --only invocation ran once; --full --base does-not-exist --dry-run passed; real verify-home fake/ask/stop passed.

First unconstrained run exposed two shell-heavy delegation timeouts; both passed focused. Bounded nextest to eight test processes rather than increasing timeouts or accepting flaky retries; full CI-profile rerun passed twice. Corrected pre-existing sleep baseline 70→78 (four missed by scanner, four from main), no new sleeps. Windows is not locally verified. Follow-up stack starts AF6 cancellation module audit; AF5 tracing, remaining AF6 modules, AF9 mining, AF10 eval stay planned.

@lg2m

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Follow-up ca7709b fixes the GitHub-only flaky gate failure: removed the duplicate 50,000-directory watermark test, retaining search::tests::ab2_depth_excluded_siblings_advance_the_scan_frontier (three pages, deterministic 70-entry budget, cursor roundtrip/progress/depth exclusions/final discovery). Focused regression passes in 0.02s; full CI-profile local gate and 6/6 smoke pass. Nextest FLKY-FL statuses now appear in failure reports.

Stacked follow-up opened: #311 (AF6.1 cancellation audit), based directly on this branch. No merge performed. Remaining AF5/AF6/AF9/AF10 work remains tracked in the plan and ENG-1028.

@lg2m

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Final independent review found and fixed one additional compound-cfg hole in 30f5168: cfg(any(test, feature=...)) must not exempt production channels. Only cfg(test) and top-level all(..., test, ...) now qualify; regression covers any, nested any and not(test). Ten lint regressions and the full CI-profile gate passed, smoke 6/6. Latest head is conflict-free; GitHub checks are still running. Stacked #311 synchronized at 7529dd7, full local gate 2438/2438 plus minimal 211/211 and smoke 6/6 green.

@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: 30f5168101

ℹ️ 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 xtask/src/lint.rs
}
}

if let Some(index) = adr_index {

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 Fail when the ADR index itself is missing

When docs/adr/README.md is deleted or renamed, adr_index remains None and this entire validation block is skipped, so cargo xtask lint passes even though none of the remaining ADRs has an index row. Report the missing index as a finding before validating individual rows.

AGENTS.md reference: AGENTS.md:L153-L153

Useful? React with 👍 / 👎.

Comment thread AGENTS.md
Comment on lines +72 to +74
- `.qq/skills/`: agent skills (`qq-mode`, `principles`, `verify-qq`,
`design-skill-or-pack`), with checked-in compatibility copies under
`.agents/skills/` (keep them identical to `.qq/skills/`). Packs with

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 Enforce synchronization of compatibility skill copies

When a maintainer updates a canonical .qq/skills/ file without manually repeating the edit under .agents/skills/, every new gate still passes because the lint only reads Rust files and the ADR index. The two agent surfaces then expose different instructions, so add a lint that compares both trees, including file presence and executable modes, rather than relying on this prose requirement.

AGENTS.md reference: AGENTS.md:L72-L74

Useful? React with 👍 / 👎.

Comment thread xtask/src/check.rs
pub fn run(args: CheckArgs) -> Result<(), CheckError> {
let root = crate::smoke::root();
let path = report_path(&root);
if args.evidence {

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 execution flags combined with --evidence

When a user runs a natural combination such as cargo xtask check --full --evidence, this early return ignores --full and exits successfully after printing the previous affected-only report, so the requested merge gate never runs. Mark --evidence as conflicting with execution flags, or run the requested gate before emitting its evidence, so --full cannot be silently reduced to report display.

AGENTS.md reference: AGENTS.md:L31-L33

Useful? React with 👍 / 👎.

Comment thread xtask/src/lint.rs
Comment on lines +243 to +255
let counted = sleeps.len();
if counted < sleep_ceiling {
findings.push(Finding {
rule: Rule::SleepInTests,
path: "xtask/src/lint.rs".to_owned(),
line: 0,
detail: format!(
"{counted} fixed sleeps in test code is below the ceiling of {sleep_ceiling}; \
lower SLEEP_CEILING to {counted} so the ceiling only moves down"
),
});
}
if counted > sleep_ceiling {

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 legacy sleep locations instead of only their count

When a change removes one existing fixed sleep and introduces a different one, counted remains equal to SLEEP_CEILING and the lint passes, despite the rule promising that every new fixed sleep fails. Preserve the legacy locations in an allowlist or require explicit per-site exemptions so deleting one violation cannot grant permission to add another elsewhere.

AGENTS.md reference: AGENTS.md:L151-L151

Useful? React with 👍 / 👎.

Comment thread .qq/skills/verify-qq/qq-home.sh Resolved
Comment thread xtask/src/smoke.rs Resolved
Comment thread .qq/skills/verify-qq/qq-home.sh Resolved
@lg2m

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

CI fixes pushed in 07dd915: retained all pagination assertions using a panic-safe thread-local test scan budget (128 entries instead of 50k fixture entries; production stays 50k). Blocking attachment/guidance/skill deadline fixture now admits the held operation with paused time, then explicitly advances past the deadline; no 500ms admission race. Full CI-profile local gate and smoke 6/6 pass. All original 15 review findings have fixing commits documented above, plus independent-review fixes. Please re-review latest head.

@codex 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: 07dd915700

ℹ️ 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 .github/workflows/ci.yml Resolved
Comment thread xtask/src/check.rs Resolved
Comment thread .githooks/pre-push Resolved
Comment thread xtask/src/lint.rs Resolved
@lg2m

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the four latest Codex findings in dab35ef/f7cb1765: pull_request labeled trigger preserves opened/synchronize/reopened; dry-run no longer removes report (real full gate → dry-run → --evidence verified); pre-push consumes every ref update and refuses unchecked non-HEAD tips; ignore reasons reject empty/whitespace with regression rows. Full CI-profile gate and smoke 6/6 pass.

@codex 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: f7cb176562

ℹ️ 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 .githooks/pre-push Resolved
Comment thread xtask/src/lint.rs Resolved
Comment thread xtask/src/smoke.rs Resolved
Comment thread build.rs Resolved
@lg2m

lg2m commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed latest findings in 423c7df: pre-push refuses dirty index/worktree/untracked state; ignore reason validation decodes JSON-style escapes and raw literal contents (unknown literal forms fail closed); Git init runs with cleared environment, isolated HOME/config and empty template in smoke and verify homes; revision watcher watches absent loose refs as well as packed refs. Full CI-profile gate and smoke 6/6 green.

@codex 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: 423c7df72a

ℹ️ 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 .githooks/pre-push Resolved
Comment thread xtask/src/lint.rs Resolved
Comment thread xtask/src/check.rs Resolved
Comment thread xtask/src/smoke.rs Resolved
@lg2m

lg2m commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review

Stack conflicts are resolved and pushed. Both PRs now report mergeable=true. Parent preserves current main action_bias wiring and previous review fixes; child includes the updated parent. Focused lint 11/11 and smoke unit tests 4/4 passed locally; the full local gate was interrupted, so remote CI is the outstanding full verification. Please review the latest tip.

@lg2m
lg2m merged commit 192c987 into main Oct 15, 2026
8 checks passed
@lg2m
lg2m deleted the build/eng-1028-agent-feedback-loop branch October 15, 2026 05:45

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

ℹ️ 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 xtask/src/check.rs
false
}
};
(passed, fs::read_to_string(&log_path).unwrap_or_default())

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 Stream gate logs when constructing reports

When a failing test or compiler invocation produces a large log, this reads the entire file back into memory despite the preceding comment claiming bounded memory; the subsequent lines().collect() also retains an index over the whole output. A sufficiently noisy failure can therefore OOM cargo xtask check before it writes last.json, losing the actionable report. Parse counts and failures with a buffered reader while retaining only the bounded tail.

AGENTS.md reference: AGENTS.md:L92-L93

Useful? React with 👍 / 👎.

repo=$(git -C "$(dirname "$0")" rev-parse --show-toplevel)
# Homes live in this checkout even when CARGO_TARGET_DIR is shared.
target=$repo/target
qq_bin=${QQ_BIN:-${CARGO_TARGET_DIR:-$repo/target}/debug/qq}

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 Resolve the verification binary before changing directories

When CARGO_TARGET_DIR is relative, such as CARGO_TARGET_DIR=target-cache, qq_bin remains relative to the caller's directory and passes the executable check, but both the qq and serve branches then cd into the isolated workspace before executing it. The command consequently looks for target-cache/debug/qq under that workspace and fails with “No such file”; resolve relative target directories against $repo when constructing this path.

Useful? React with 👍 / 👎.

Comment on lines +152 to +154
port=$(python3 -c 'import socket; s=socket.socket(); s.bind(("127.0.0.1",0)); print(s.getsockname()[1])')
echo "$port" > "$home/port"
fake_server "$home" "$port" >"$home/fake.log" 2>&1 &

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 Bind the fake server before publishing its port

When multiple verification homes or other loopback services start concurrently, the allocator closes its ephemeral socket before fake_server binds the selected port, so another process can claim it in between. The fake then either fails nondeterministically or the readiness probe can connect to an unrelated HTTP service, defeating the isolated verification drive; start the server on port 0 while retaining the listener and communicate the actual bound port back to the script.

AGENTS.md reference: AGENTS.md:L85-L87

Useful? React with 👍 / 👎.

Comment on lines +34 to +36
| `{"tool":"write_file","args":{"path":"x.txt","content":"hi"}}` | (read-only) | `tool_call_finished` with state `denied`; exit 0; no `x.txt` |
| same | `--approval auto` | state `completed`; `workspace/x.txt` exists |
| `{"tool":"shell","args":{"command":"rm -f gone.txt"}}` | `--approval auto` | `tool_approval_requested`, then `tool_approval_resolved` with `denied` |

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 Terminate scripted tool runs with a text reply

When an agent follows any of these first three rows literally, script.jsonl contains only the tool call, and the fake repeats its last reply after the runtime sends the tool result or denial back to the model. The run therefore requests the same tool repeatedly until a stall or turn limit instead of producing the documented exit or single approval result. Specify a second {"text":"done"} reply for each row that is expected to complete.

Useful? React with 👍 / 👎.

http://$ADDR/v1/workspaces/$WS/events > $QQ_HOME/evidence/sse.txt &
SID=$(api /v1/sessions "{\"command_id\":\"$(cid)\",\"command\":{\"type\":\"create_session\",\"workspace_id\":\"$WS\",\"model\":{\"model\":\"verify/model\"}}}" | jq -r .outcome.session_id)
api /v1/sessions/prompts "{\"command_id\":\"$(cid)\",\"command\":{\"type\":\"submit_prompt\",\"session_id\":\"$SID\",\"input\":[{\"type\":\"text\",\"text\":\"hi\"}]}}" | jq -c .outcome
sleep 3; rg -o '"type":"(session_created|text_appended|run_finished)"' $QQ_HOME/evidence/sse.txt

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 Wait for the SSE completion event instead of sleeping

On a loaded host, the submitted run can take longer than three seconds, so this recipe can inspect the evidence file before run_finished arrives and falsely report that the end-to-end server path is broken; on a fast host it also waits longer than necessary. Poll or stream until the specific run's completion event is observed rather than using a fixed delay.

AGENTS.md reference: AGENTS.md:L169-L171

Useful? React with 👍 / 👎.

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