Skip to content

fix(init): write language-appropriate agent instructions (#13596) - #13685

Merged
EffortlessSteven merged 5 commits into
mainfrom
claude/13596-init-agents-language
Nov 8, 2026
Merged

EffortlessSteven merged 5 commits into
mainfrom
claude/13596-init-agents-language

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven Zimmerman, via Claude.

Governing issue or accepted claim: #13596
Acceptance delta (one sentence): ripr init --agents writes pytest/unittest or jest/vitest verify and assertion advice (no cargo, no guided ripr repair promise) and matching Cursor globs for Python and TypeScript/JavaScript roots, while Rust roots keep the Rust text unchanged.

Summary

  • Detects the root's languages with the existing detect_languages markers (Cargo.toml, pyproject/setup.py/pytest.ini, package.json/tsconfig).
  • Rust-only or undetected root: the Rust block is written byte for byte (still equal to docs/AGENT_QUICKSTART.md).
  • Python / TypeScript-JavaScript only: a preview block with pytest -k / unittest, npx jest -t / npx vitest run -t, exact-value assertion advice, and a note that ripr repair / ripr agent stub / --seam-id are Rust only. The route is ripr check --format agent, then a hand-written test; ripr agent repair --gap-id only if check prints it. I checked this by running the binary in scratch Python and TypeScript repos: ripr repair <probe> and ripr agent repair --seam-id <probe> refuse (exit 3 / 2, "covers Rust files only"), check --format agent / explain work, and a strengthened test moves the finding to exposed.
  • Rust plus another language: the Rust block plus a short preview note.
  • Cursor rule globs and description follow the detected languages.
  • Docs: new "Python and TypeScript repos" section in docs/AGENT_QUICKSTART.md; changelog fragment.

Verification

Ran locally (final head, except where noted):

  • cargo fmt --check
  • cargo test -p ripr --lib init_agents (17 passed, includes the quickstart parity test and new variant tests)
  • cargo test -p ripr --test cli_smoke init_agents (new init_agents_writes_language_appropriate_instructions and the existing init-agents test pass) and --test init_agents_block_smoke
  • Earlier full cargo test -p ripr --test cli_smoke run on the prior commit state: 710 passed, 19 failed; the failures are root-discovery / legend / git-boundary tests that fail in this sandboxed worktree (e.g. "a changed file is absent from the working tree"), none touch init.
  • Earlier cargo test -p xtask: 5196 passed, 3 failed, all reports::dx_scoreboard (clone/checkout), unrelated.

Not run locally: cargo xtask precommit, goldens and check-user-text (shared cargo lock contention); full precommit/xtask/goldens proof is left to hosted CI.


Generated by Claude Code

`ripr init --agents` now detects Python and TypeScript/JavaScript roots and
writes pytest/unittest or jest/vitest verify commands and exact-assert advice,
without cargo or a promise of guided `ripr repair` (Rust only). The Cursor rule
globs and description follow the detected languages. Rust roots keep the Rust
text byte for byte; mixed roots keep it and add a short preview note.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLTBWXG3mQZ3zTPeoKz
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven self-assigned this Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 17 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 152 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 5fca45aa-d5e5-4b09-96fa-d6f4be665371
Commits

Reviewing files that changed from the base of the PR and between af8ddd5 and b9d98ba.

Files selected for processing: 7

  • .ripr/traceability.d/init-agents-language.toml
  • changelog.d/13596-init-agents-language.md
  • crates/ripr/src/cli/commands/init.rs
  • crates/ripr/src/cli/commands/init_agents.rs
  • crates/ripr/tests/cli_smoke.rs
  • docs/AGENT_QUICKSTART.md
  • docs/specs/RIPR-SPEC-0009-defaults-first-adoption.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Step 5 now reuses the json-compact rule (findings == exposed, complete
outcome kind, analysis_complete) and the Rust STOP list, so no_static_path,
reachable_unrevealed, *_unknown and empty-scope runs no longer read as done.
Reword the Rust-only repair note, add the advisory/findings==exposed note to
the mixed block, and pin all of it in tests.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLTBWXG3mQZ3zTPeoKz
…e changelog issue-first (#13596)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLTBWXG3mQZ3zTPeoKz
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 8, 2026 13:08
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

REVIEW_READY

Scope: the complete diff against main at c67d0f7.

  • Detection reuses config::language_detection::detect_languages. A Rust-only or undetected root writes AGENT_BLOCK byte for byte, so the parity test with docs/AGENT_QUICKSTART.md holds.
  • The Python and TS/JS preview blocks fixed the earlier fail-open DONE rule. Step 5 now matches the Rust json-compact rule: exit 0, a complete outcome kind, analysis_complete: true, summary.findings = summary.exposed, and STOP on missing fields or document_complete: false. The block says explicitly that gaps=0 alone is not enough. The full STOP list is restored, and unit tests pin every DONE and STOP needle in both the Python and TS blocks, plus the absence of the old weak rule.
  • Repair guidance is accurate for preview languages. ripr repair and --seam-id are Rust only, and a --gap-id start runs only when ripr check prints it. This matches the binary behaviour observed in the scratch repos (exit 3 / exit 2 with "Rust only").
  • Mixed roots get the Rust block plus a note that the preview results are advisory and step 5 needs findings = exposed. I reworded the note so "advisory" attaches to the Python/TS results, not to ripr repair.
  • The Cursor globs and description follow the detected languages. The quickstart documents root plus immediate-children detection. The changelog fragment is named issue-first.

Evidence: 17 local init_agents unit tests passed on this source, cli_smoke init_agents passed 2, init_agents_block_smoke passed 2, and rustfmt --check was clean. Hosted CI runs precommit, goldens and check-user-text.


Generated by Claude Code

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

Devin Review found 4 potential issues.

Devin Review

Comment thread crates/ripr/tests/cli_smoke.rs Resolved
@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit b9d98ba2a67f · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=af8ddd5e1bf178c8352907a9a19b1e130853afbf findings=115 gaps=35 exposed=1 infection_unknown=7 propagation_unknown=5 reachable_unrevealed=30 static_unknown=25 weakly_exposed=47
reachable_unrevealed|crates/ripr/src/cli/commands/init.rs:362|.map(\|config\| config.languages().enabled().to_vec())|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:call_deletion:122ed78a
reachable_unrevealed|crates/ripr/src/cli/commands/init.rs:362|.map(\|config\| config.languages().enabled().to_vec())|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:side_effect:ede8a69d
reachable_unrevealed|crates/ripr/src/cli/commands/init.rs:365|.map(\|config\| config.languages().enabled().to_vec())|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:call_deletion:122ed78a.2
reachable_unrevealed|crates/ripr/src/cli/commands/init.rs:365|.map(\|config\| config.languages().enabled().to_vec())|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_cli_commands_init.rs:side_effect:ede8a69d.2
weakly_exposed|crates/ripr/src/cli/commands/init_agents.rs:91|rust: true,|missing=rust: true,|test=t2|id=probe:crates_ripr_src_cli_commands_init_agents.rs:field_construction:d594f5a2
weakly_exposed|crates/ripr/src/cli/commands/init_agents.rs:92|python: false,|missing=python: false,|test=t2|id=probe:crates_ripr_src_cli_commands_init_agents.rs:field_construction:549b5a87
weakly_exposed|crates/ripr/src/cli/commands/init_agents.rs:93|typescript: false,|missing=typescript: false,|test=t2|id=probe:crates_ripr_src_cli_commands_init_agents.rs:field_construction:daafcd7c
weakly_exposed|crates/ripr/src/cli/commands/init_agents.rs:94|python_not_enabled: false,|missing=python_not_enabled: false,|test=t2|id=probe:crates_ripr_src_cli_commands_init_agents.rs:field_construction:13ab4c9e
weakly_exposed|crates/ripr/src/cli/commands/init_agents.rs:95|typescript_not_enabled: false,|missing=typescript_not_enabled: false,|test=t2|id=probe:crates_ripr_src_cli_commands_init_agents.rs:field_construction:786903c8
t1=crates/ripr/src/cli/commands/init.rs:1702 init_roots_drop_the_trailing_current_dir_segment unknown miss=assertion_inert
t2=crates/ripr/src/cli/commands/init_agents.rs:762 detect_reads_the_root_markers relational_check `assert!(AgentLanguages::detect(&root, &ALL_ENABLED).rust);` miss=weak_assertion
+26 more gaps not shown; `--format json` lists all
limits=infection_unknown:7,propagation_unknown:5,static_unknown:25,weakly_exposed:42
next=ripr explain --root /home/runner/work/ripr-swarm/ripr-swarm/head --base af8ddd5e1bf178c8352907a9a19b1e130853afbf --committed --mode draft --format agent probe:crates_ripr_src_cli_commands_init.rs:call_deletion:122ed78a

Took 123s.

…s Cursor front matter (#13596)

- Only detected AND enabled ([languages].enabled of the config init writes
  or keeps; unreadable config enables none) preview languages get a loop;
  a detected but not enabled language is named as not analyzed.
- --force refreshes Cursor front matter only when it exactly matches a
  shape ripr generated; user front matter and notes are kept.
- Preview DONE/VERIFY: put the new test in the analyzed source (commit it
  or --worktree on FIND and VERIFY) and STOP on unanalyzed_working_tree.
- RIPR-SPEC-0009 requirement, acceptance example and traceability mapping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLTBWXG3mQZ3zTPeoKz

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

REVIEW_READY

Scope: the complete diff against main at 2e3e3b4, including the c67d0f7 review and the four Devin findings.

  • Enabled-language gating: init_plan reads the enabled set from the config being written (targets[0] is always the config target) or from the kept ripr.toml. An unreadable config enables nothing. Preview loops appear only for languages that are both detected and enabled, and a disabled language gets an explicit "NOT analyzed" note pointing to ripr doctor. The cli_smoke TypeScript case now uses tsconfig.json, the marker that actually turns TS analysis on.
  • Cursor front matter: refreshed on --force only when it exactly matches a ripr-generated shape. User front matter and other agents' files are untouched, and the refresh is idempotent. The regression test covers all of this.
  • Dirty tree: the preview VERIFY step says to commit the test or use --worktree consistently, and DONE STOPs on unanalyzed_working_tree: true, matching the Rust block.
  • Spec: RIPR-SPEC-0009 has the behavior bullet, an acceptance example and mappings, and .ripr/traceability.d/init-agents-language.toml maps the tests and code.

Evidence (worker, this head's source): init_agents lib 19 passed, cli_smoke init_agents 2 passed, init_agents_block_smoke 2 passed, cargo fmt --check clean. check-traceability and check-spec-format passed with the existing xtask binary (xtask is unchanged on this branch). Hosted CI runs the rest.


Generated by Claude Code

…S analyzers (#13596)

The Rust-only feature lane correctly reports Python files as not analyzed,
so the preview-loop expectations only hold when both analyzers are built.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLTBWXG3mQZ3zTPeoKz

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

REVIEW_READY

Scope: the complete diff against main at b9d98ba. The only change since 2e3e3b4 gates init_agents_writes_language_appropriate_instructions on all(feature = "lang-python", feature = "lang-typescript"). The Rust-only feature lane failed it with pyproject.toml: missing "pytest -k". That was correct product behavior: a build without the Python analyzer reports Python files as not analyzed instead of promising the preview loop. The source and oracle review from 2e3e3b4 carries forward.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit a3edbf9 into main Nov 8, 2026
74 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/13596-init-agents-language branch November 8, 2026 15:14
EffortlessSteven pushed a commit that referenced this pull request Nov 8, 2026
Picks up the regenerated docs/CLI_REFERENCE.md (#13604) that the
cli_reference_doc test needs after #13685/#13731.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLUGWB1o9vpixujro7H
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants