Skip to content

Land three-harness audit fixes: schema backfill lockstep, freshness injection gate, shortcuts exact-snippet uninstall - #2752

Merged
namastex888 merged 11 commits into
devfrom
wish/harness-audit-landing
Aug 7, 2026
Merged

namastex888 merged 11 commits into
devfrom
wish/harness-audit-landing

Conversation

@namastex888

@namastex888 namastex888 commented Aug 6, 2026 •

Copy link
Copy Markdown
Contributor

Gate-zero receipt — harness-audit-landing

  • bun: 1.3.9 -> 1.3.14 (engines pin >=1.3.10) OK
  • Clean-HEAD baseline: temporary worktree at HEAD (6d252e6), bun install, NO stashing. bun run check:fast green; bun test 2994 pass / 18 fail (3012 tests, 126 files). Scratch worktree extraction mangled file modes (666/777 vs committed 644/755) — modes restored to committed values and the role-agent parity gate re-run green.
  • Working tree (the three fixes): bun run check:fast green except wishes:lint, which fails ONLY on the unrelated untracked .genie/wishes/roadmap-truth/WISH.md (unsupported status REVIEWED; stale design SHA) — not this wish's files. bun test 3014 pass / 13 fail (3027 tests, 127 files).
  • 12 failures survive BOTH runs (network/timing-sensitive): 9x exact GitHub release asset reconciliation, 2x failed-launch harness cleanup, dispatcher hot-path latency, doctor 120ms latency budget. Logged as separate findings; NOT fixed here (wish OUT).
  • Working-tree-only failure: 1 release-reconciliation retry test (network family, one-sided flake; passed on baseline; not attributable to these fixes). Baseline-only: 5 timing flakies + the mode-artifact parity gate (re-run green after repair).
  • Conclusion: zero failures attributable to the three ready fixes.

Gate-zero receipt (Group 1)

  • bun --version = 1.3.14 (engines require >=1.3.10) ✓
  • Clean-HEAD baseline (temporary worktree at 73ac11a14, fresh bun install, no stash): bun run check:fast green; bun test green except 10 infra/timing failures — 6 reconcile-release-assets tests timing out against live GitHub API calls, 1 doctor 120 ms latency-budget test, 3 codex integration harness-root spawn-cleanup tests. None touch files this branch modifies.
  • Working tree: bun run check:fast green; bun test 3014 pass / 14 fail — the same failure classes (release-reconciliation API timeouts, doctor latency budget, integration spawn cleanup; the exact set shifts run-to-run as the tests hit live GitHub). Zero failures attributable to this branch's changes.
  • Per the wish, surviving failures are logged, not fixed here (codex-delivery class; CI's authenticated runners are the authority — the Unit job's bun test passed on the merge ref).

Dev CI repair carried by this PR

dev was red on two gates after the #2751 (roadmap-truth) and #2736 (kimi-plugin) merges:

  1. Wishes lint — roadmap-truth merged with status REVIEWED + a stale design-evidence digest. Fixed on dev via fix(ci): restore dev gate after roadmap-truth merge (wishes-lint + codex smoke) #2754 (status -> SHIPPED; evidence re-stamped with the re-reviewed content digest; blocks edge qualified cross-repo).
  2. Codex Plugin Smoke — b0e77cd15 deleted plugins/genie/skills/wizard; the retirement only retires payload-shipped skills, so the hardcoded "23 retired" oracle broke (journal accepted 22). The smoke now derives expectations from the shipped payload (e1331c188): retired = seeded intersect shipped skills, dropped-skill fallbacks asserted preserved, doc-contract asserts mirror parity instead of a hardcoded 46-card count. Validated on both payload compositions.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: bc9ba9bb-125c-4a67-bc22-33d192750468

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@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: 73ac11a141

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


function ensurePromptRl(): readline.Interface {
if (promptRl) return promptRl;
promptRl = readline.createInterface({ input: process.stdin, output: process.stdout });

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 Close the readline interface after the final prompt

When shortcuts install or shortcuts uninstall is run from an interactive terminal, stdin never reaches EOF and this persistent readline interface is never closed. After the final answer, the command prints its completion message but remains alive indefinitely until the user sends EOF or interrupts it; close or pause the interface once the command has finished prompting.

Useful? React with 👍 / 👎.

Comment on lines +263 to +264
while (kept.length > 0 && kept[kept.length - 1] === '') kept.pop();
const newContent = kept.length > 0 ? `${kept.join('\n')}\n` : '';

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 Preserve the original config file ending during uninstall

When a pre-existing rc file lacks a final newline or ends with multiple blank lines, an install/uninstall round trip changes those user-owned bytes: the loop removes every trailing blank line and the reconstruction always adds exactly one newline. Remove only the exact appended byte range or retain the untouched prefix and suffix so uninstall restores the original config exactly.

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

Useful? React with 👍 / 👎.

completeTask violated the never-clobbered invariant claimTask/releaseTask
already implement: read-then-unconditional-UPDATE let any caller finish
another worker's claimed card. Move the claim predicate into the UPDATE:

  WHERE id = ? AND status IN ('ready','in_progress')
    AND (claimed_by IS NULL OR claimed_by = ?)

Identity reconciliation FIRST (this commit's resolver change, predating the
SQL): claim-side (handleCheckout worker = GENIE_AGENT_NAME ?? 'cli') and
complete-side (resolveEventAuthor author = GENIE_AGENT_NAME ??
GENIE_AGENT_ID ?? null) were two diverging fallback chains - a
GENIE_AGENT_ID-only runtime claimed as 'cli' but completed as the ID.
Both now resolve through resolveWorkerIdentity (NAME ?? ID ?? 'cli'), so a
plain no-env 'genie task checkout' -> 'genie task done' still completes.

Zero changed rows -> typed TaskCompleteError mirroring releaseFailure
(card status carried for the operator). Identity-less completion of a
claimed card is refused; unclaimed cards remain completable without
identity. No force/override knob - release-then-reclaim composes from
existing verbs. Migration for in-flight claims: release (stays
identity-free) then re-claim under the new identity.

Tests: racing identities (claimant wins, other gets typed refusal),
non-claimant refused, identity-less complete of claimed card refused,
default-CLI regression, done-guard.\n\nCo-Authored-By: Empryo <noreply@empryo.com>
The wish-group execution machine (state transitions, drift signatures,
cycle detection, typed errors) has zero production callers — wish_groups
has no writer, so every MCP wish-status query returned a guaranteed-empty
set. Deleted by exact symbol list per the harness-audit-landing wish:
assertWishSignature, startWishGroup, completeWishGroup, promoteReadyGroups,
getWishGroups, getWishGroup, mapWishGroup, createWishGroups,
computeGroupsSignature, wishSigKey, validateGroups, validateGroupRefs,
detectGroupCycles, WishGroupStateError, WishGroupDriftError, WishGroupDef.

Asymmetric by design:
- CREATE TABLE IF NOT EXISTS wish_groups DDL stays inert, annotated
  vestigial-pending-drop; no schema version bump (older binaries'
  validateSnapshot expects the key).
- exportState keeps emitting wish_groups: [] via the live query (table is
  empty in production); SNAPSHOT_TABLE_KEYS unchanged.
- importState tolerates-and-drops a legacy wish_groups snapshot array
  instead of inserting rows.
- genieWishStatus preserves groups: [] in WishStatusPayload (WishGroupRow
  survives to type it); resolveWishBranch loses the verified-launch-
  worktree step — safe, since no production writer exists.
- listWishSlugs (UNION on wish_groups), hasOperationalState, wipeAllTables
  untouched; group_name on tasks untouched.
- TAXONOMY.md loses the state-machine prose; column reference stays with
  the vestigial note.

Test rework: wish-group state-machine blocks removed; export round-trip
asserts the field is empty; mcp/ui-bridge tests assert groups is [].
dev's Codex Plugin Smoke has been red since b0e77cd (skills
runtime-generic refactor, PR #2736) deleted plugins/genie/skills/wizard:
the retirement only retires a fallback whose skill the authenticated
payload ships (proven-ownership scoping in runtime-integrations.ts), so
the seeded wizard fallback is preserved and the smoke's hardcoded
'23 retired' / '46 skill cards' assertions fail (journal accepted 22,
expected 23).

The oracle now derives its expectations instead of hardcoding them:
- pure-23/mixed: expected retired = seeded ∩ payload-shipped skills;
  dropped-skill fallbacks are asserted PRESERVED (strengthens the oracle).
- post-upgrade doctor assertions accept N preserved clean fallbacks.
- doc-contract: mirror parity (plugins/genie/skills vs skills/) plus
  non-empty, instead of a rot-prone hardcoded card count.

Validated on both compositions: payload with wizard (23 retired) and
without (22 retired, wizard preserved); full suite green on 1.3.14.
Group 2 (claimed_by CAS fence) required every claim-then-complete
caller to thread identity; two callers were missed by the wish's
four-file enumeration and broke CI:

- tests/integration/codex-project-route-migration.test.ts statically
  imported createWishGroups (deleted in the Group 3 wish-group
  removal) — the integration file is env-gated on CI so the crash
  only surfaced there. Removed the dead import/call; the sentinel
  assertions only use wish slugs, the group row was incidental.
- tests/e2e/v5-lifecycle.sh claimed T1 as $WORKER then completed
  with no identity — resolveEventAuthor() floors at 'cli', which
  the fence refuses. Completion now threads GENIE_AGENT_NAME=$WORKER.

Both verified locally: integration file 2/2, e2e PASS.
Merge origin/dev into wish/harness-audit-landing: carries the merged
roadmap-truth + kimi-plugin + auto-version changes, resolving the mcp
read-only proof test graft (dev version adapted to the wish-group
removal) and keeping the branch mergeable for #2752.
The auto-version bump (f5bbadc) ran before the kimi manifest joined
this branch's tree line, so plugins/genie/.kimi-plugin/plugin.json was
left at 5.260805.1 while package.json moved to 5.260807.2 — the same
drift class #2757 fixed on dev. Align it so the release-payload gate
passes on the merge tree.
All three groups shipped: ready-fixes PR #2752 open with gate-zero
receipt, completeTask fence landed, wish-group machinery deleted.
@namastex888
namastex888 merged commit 440491c into dev Aug 7, 2026
17 checks passed
namastex888 added a commit that referenced this pull request Aug 7, 2026
@automagik-genie
automagik-genie deleted the wish/harness-audit-landing branch September 25, 2026 04:51
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