Skip to content

CRW-547: wire crw pabcd review-round, metric and divergence verb rows - #562

Merged
thisisjun786 merged 5 commits into
devfrom
codex/crw-547-c6-verbs
Oct 5, 2026
Merged

thisisjun786 merged 5 commits into
devfrom
codex/crw-547-c6-verbs

Conversation

@thisisjun786

@thisisjun786 thisisjun786 commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

What changed

crw pabcd could not reach the three CLI libraries the earlier port issues added (review-round, metric, divergence). This wires them and claims the corpus fixtures those rows can drive.

  • internal/harness/pabcd.go: three new rows in the Verbs table — review-round, metric, divergence — appended after scan, one per line. The receipt row is untouched (a sibling branch edits it), so both merge as local hunks.
  • internal/harness/pabcd_cli.go: three adapters reproducing the CXC v0.2.40 dispatcher branches exactly:
    • review-round: parse refusals keep the review-round: prefix on stderr with exit 1; a library error (the oracle's uncaught throw) answers crw cli failed: exit 1; every result goes to stdout with its own code.
    • metric: reads stdin only when the first argument after the verb is exactly ingest, and before resolving the working directory; overflow prints metric: stdin exceeds 4194304 bytes to stderr and exits 1; otherwise the result goes to stdout with its code.
    • divergence: a library error (the mode write) answers crw cli failed: exit 1; every result goes to stdout with its code.
  • contract/notes/cxc/CRW-547.json: claims the 22 cxc corpus fixtures these rows can drive, in the replayer's format.

Expected behaviour and acceptance criteria

  1. The review-round, metric and divergence paths of CXC's cli.ts are reachable through crw pabcd as three verb rows over the already-ported libraries, with the oracle's streams and exit codes (c1).
  2. Red-first Go tests of the adapters' streams and exit codes, then green; the cli and cli-help fixtures of the three verbs replay green (c2).
  3. The corpus classification is truthful: no fixture is claimed that this PR cannot drive (c3).
  4. Existing CRW contracts, goldens and tests are unchanged apart from the one absence pin named below; the activation surface is untouched (c4).
  5. Behaviour is ported as-is from CXC v0.2.40; every defect is listed here and recorded in the port's defect record (c5).
  6. No CGO, no Node at run time, no package-level initialization (c6).
  7. The measured diff is within the operator size rule (c7).
  8. One PR into dev, every CI job green on one head, the one Devin and one Codex Code/Security review waited for, blocking findings fixed or rebutted (c8).

Oracle sources ported

plugins/codexclaw/components/pabcd-state/src/cli.ts of CXC v0.2.40 (commit 3c1459acadeb1906d97c00a598e1457327ae372d): the metric branch (lines 156-181), the divergence branch (183-189), the review-round branch (310-330) and the shared readStdin/MAX_STDIN_BYTES (76-99), re-used through this repository's own harness.ReadStdin. The ported libraries are internal/pabcd/cli/metric.go, divergence.go, review_round_args.go and review_round_run.go.

Note on the criteria text: it speaks of a 64 KiB stdin cap; the oracle's bound is MAX_STDIN_BYTES = 4 * 1024 * 1024 (64 KiB is only the read chunk size). Parity follows the oracle: the adapter uses the existing 4 MiB bounded read and prints the interpolated bound in the overflow message.

Commands and results

  • go test -count=1 ./internal/harness -run TestPabcdC6 -v — red first: 30 failing subtests, each invalid choice: "review-round" with exit 2; after the wiring the same command exits 0 with no failures.
  • go test -count=1 ./internal/harness — exit 0 (whole package).
  • go test -count=1 ./internal/contracttest -run 'TestDomain/cxc/(cli-help__(review-round|metric|divergence)__|cli__(divergence__mode_and_candidates|metric__record_show_kind_parse_line|review-round__show_and_open_refusals))' -v — exit 0, 22 PASS / 0 FAIL for the claimed fixtures.
  • make lint exit 0; CGO_ENABLED=0 go build ./... exit 0; GOOS=darwin go vet ./internal/harness/... exit 0.
  • go run -tags dev ./cmd/crw-dev ci plugin exit 0 with no digest change; ci validate exit 0; ci contracts exit 0 (40 title fixtures replayed; the cxc corpus agrees with its specs).
  • git diff --check clean; branch-history blob scan: no blob over 1 MB; pinned secret scan (gitleaks 8.30.1, the CI version): no leaks found.

Corpus fixture classification

Entry point for every claimed fixture is its corpus cli step mapped through the CLI name table to crw pabcd <verb> and replayed by internal/contracttest. 22 fixtures pass with this PR alone (19 help: 5 divergence + 8 metric + 6 review-round; 3 cli: cli__divergence__mode_and_candidates, cli__metric__record_show_kind_parse_line, cli__review-round__show_and_open_refusals), recorded as identical in contract/notes/cxc/CRW-547.json. Two review-round cli fixtures stay pending because they run the loop and orchestrate verbs, which have no row on this base: cli__review-round__open_signoff_and_binding_verdict and cli__review-round__unparsed_signoff_noted_and_abort. No fixture is claimed green that this PR cannot drive.

Diff size

423 changed lines, 422 added and 1 deleted; generated data: none. Composition: implementation 76 (rows 3, adapters 71, the usage-line pin 1 add + 1 delete), tests 315 (the new internal/harness/pabcd_c6_test.go), issue notes 32. Every file is far below 1 MB.

Existing-test change (the only one)

One line in internal/harness/pabcd_cli_test.go: the dispatcher --help expectation gains the three verb names, the row's own absence pin that a command-adding issue is allowed to update. Nothing else in existing tests, fixtures or goldens changes, and no file under plugins/crw/wiring/hooks, plugins/crw/skills or any .codex-plugin directory is touched.

Defects

No new defect found in these three paths. The metric, divergence and review-round defects found while porting the libraries are already recorded in the port's defect record by the earlier issues, so this PR appends nothing there. One stale comment remains in internal/pabcd/cli/metric.go ("64 KiB bound" where the oracle bound is 4 MiB); it is a follow-up note only and outside this change.

Head movement after the external reviews

Devin Review (no issues found) and the Codex Code Review (completed, no findings, thumbs-up) each ran once, on head 37c1c5cf. The final head 274ad9b4b adds one test-only commit: the three crw_cli_failed assertions now also pin the trailing newline of the library-error stderr, closing a minor finding from this issue's own independent review. The implementation is unchanged, and CI is green again on the final head (run 37254720239, all ten jobs including dev-gate).

Out of scope

The receipt row and receiptVerb (a sibling branch edits them), the loop and orchestrate verb rows, library code, fixtures/goldens/existing tests beyond the single pin above, the activation surface, installation, release, merge, and any Linear write.


Devin Review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for security reviews. Please try again later.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 5, 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-05T02:08:11.004679Z 37c1c5c PR opened
ℹ️ 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.

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@thisisjun786
thisisjun786 merged commit 2986b22 into dev Oct 5, 2026
10 checks 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