test(brownfield): exercise the decision drafting flow end to end - #677
Conversation
|
Warning Review limit reached
Next review available in: 46 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 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 configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request adds an end-to-end test for brownfield decision extraction and drafting. It creates a configured fixture, indexes evidence, drafts a bound decision, verifies ChangesBrownfield decision flow
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/kernel.rs`:
- Around line 1982-1983: Update the test setup around temp_root and
write_extraction_flow_fixture to create the fixture directory with
tempfile::TempDir, retain the TempDir in scope for RAII cleanup, and pass its
.path() wherever a filesystem path is required.
🪄 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: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 67ba42a4-0d6c-4281-a22a-91cef61c39f7
📒 Files selected for processing (2)
meta/todos/todo.brownfield-extraction-drafting-test.mdtests/kernel.rs
Closes todo.brownfield-extraction-drafting-test. Success criterion: a test drives the shipped extraction flow (onboard decisions --json, hand-authored `method: primary` research, `cairn decision new --node --informed-by`) against a fresh temp fixture and asserts the drafted artefact binds the `node` a bound entry published, verbatim, with status exactly `proposed`. The report side of the flow is already covered; what was uncovered is that a bound entry carries through the writer into an artefact with a real binding. Assertions read parsed frontmatter fields rather than scanning lines, so a draft with an empty `nodes:` list cannot pass on an unrelated body line, and the node identity is proved by `--json get` returning that exact id: bare `get` also resolves names and unique dotted suffixes, so its exit status alone would accept a label. `informed_by` is asserted too, because the writer accepting the flag and dropping it would otherwise exit 0. The fixture is a temp root carrying ordinary project material only (a docs/adr document, a README Decision section, an `// invariant:` comment) plus the blueprint the flow requires, and it carries no cairn artefact directory until the flow creates one.
afe411f to
5517375
Compare
Closes
todo.brownfield-extraction-drafting-test(nodecairn.brownfield).Success criterion
A test drives the shipped extraction flow end to end against a fresh temp fixture, in the order
.claude/skills/cairn-dev/references/task-brownfield-decision-extraction.mdnames:cairn onboard decisions --json, hand-author the fixture's ownmethod: primaryresearch artefact, thencairn decision new <slug> --node <id> --informed-by <research-id>with thenodea bound entry published, verbatim. It asserts on the drafted artefact: itsnodes:binding names a node the fixture blueprint declares (proved bycairn get <node>inside the fixture) and its status is exactlyproposed.Why
The report side is already covered by
todo.brownfield-onboard-decisions-index. What was uncovered is that a bound entry carries through the writer into a decision artefact with a real binding and a non-accepted status.Fixture
A temp root (not a checked-in tree, same shape as the existing onboard coverage) carrying ordinary project material only: a
docs/adr/document, a READMEDecisionsection, an// invariant:source comment, plus thecairn.blueprintthe flow requires, whose System block declaresdecisionsandresearch. No cairn artefact directory exists before the run; the flow creates it. Nothing is written inside this repository.Mutation check
Reading
detail(the path-derived discovery candidate id) instead ofnodefails the test, so the binding assertion defends a real contract.Gates
cargo fmt --check,cargo clippy --all-targets --all-features -- -D warnings,cargo test(full suite, unpiped, exit 0),cairn scan --strict(exit 0),cairn hook all(exit 0) all pass.