Repository navigation
docs(j): top-5 doc fixes (README version, env-var table, rustdoc, ARCHITECTURE.md, 8 examples) - #114
KooshaPari wants to merge 5 commits into
Conversation
The README claimed the latest fork release was v0.85.0-k1.0.0 on lines 15 and 55 but the workspace is three versions ahead at v0.85.1-k1.1.1 (Cargo.toml workspace version, audit 2026-10-17). tx-agent: jcode tx-validated: manual tx-task: top5-2026-10-17 tx-scope: README.md tx-intent: align README version claims with Cargo.toml workspace version
…ons) Per the J-docs audit, only ~14 of 429+ env vars were documented anywhere in the README. This commit adds a canonical catalog at docs/ENVIRONMENT.md generated from: 1. crates/jcode-base/src/config/env_overrides.rs (151 bindings, grouped by the existing section comments: Server/operator, Keybindings, Provider, Ambient, Autojudge, Autoreview, JADE cloud relay, etc.) 2. A workspace-wide rg pass over crates/ and src/ for every JCODE_* string-literal that isn't already bound in env_overrides.rs 3. A curated list of 130 third-party env vars from upstream libraries and integrations (HERDR_*, GHOSTTY_*, KITTY_*, TMUX_*, ANTHROPIC_API_KEY, OPENAI_API_KEY, ...). Total: 626 env vars documented across 20 sections. The catalog is idempotently regenerated by scripts/docs/build_env_table.py; the .lst snapshot lives alongside. tx-agent: jcode tx-validated: manual tx-task: top5-2026-10-17 tx-scope: docs/ENVIRONMENT.md, scripts/docs/ tx-intent: provide canonical reference for all JCODE_* + third-party env vars
Per J-docs audit §1 (rustdoc coverage), the following foundation types were either undocumented or had single-line rustdoc that did not explain what the type is for or how downstream code uses it: - crates/jcode-provider-core::Provider (audit row 4: trait; expanded the existing one-line /// to a multi-paragraph description covering the trait contract, the harness/provider-agnostic call site story, and the sibling modules that own selection/retry/billing). - crates/jcode-swarm-core::SwarmRole + SwarmLifecycleStatus (audit row 5; expanded to explain the role model and the rationale for the wider-than-usual lifecycle state set). - crates/jcode-config-types::CompactionMode + AgentMode (audit row 6; expanded to describe the three policies / three modes and the runtime env var + serialised-form details). - crates/jcode-protocol::TranscriptMode + HistoryMessage (audit row 7; expanded to explain the four transcript merge modes and the field-by-field shape of the sync wire message). - crates/jcode-tool-core::StdinInputRequest + ElicitRequest (audit row 8; expanded to explain the tool→host synchronous prompt and the tool→host structured elicitation flow). All five affected crates pass cargo check. tx-agent: jcode tx-validated: cargo-check tx-task: top5-2026-10-17 tx-scope: crates/jcode-provider-core, jcode-swarm-core, jcode-config-types, jcode-protocol, jcode-tool-core tx-intent: provide paragraph-length rustdoc on every Foundation public type
Per J-docs audit Fix 4 ("No top-level ARCHITECTURE.md"), the workspace
ships 92 crates but no single overview for newcomers. The five
topic-specific docs in docs/ (SERVER_ARCHITECTURE, SWARM_ARCHITECTURE,
MEMORY_ARCHITECTURE, MODULAR_ARCHITECTURE_RFC,
MULTI_SESSION_CLIENT_ARCHITECTURE) cover their subsystems in depth but
do not give a one-page map of the whole compile graph.
This adds a 274-line ARCHITECTURE.md at the repo root with:
- A 5-line layering explanation (Foundation data contracts, Base,
App core, Presentation, Root + CLI) derived from the existing
jcode-base / jcode-app-core / jcode-tui re-export pattern in the
workspace's lib.rs files.
- A 92-crate map grouped by functional concern (foundation data
contracts, foundation behavior contracts, provider system, core
behavior, app core, plan & graph, TUI presentation, build &
logging, terminal & platform, HERDR / multi-harness) with one
row per crate, the on-disk path, and a one-line summary derived
from the crate's Cargo.toml description, its top-of-file //!
rustdoc, or its most prominent pub items.
- A binary-build table covering the five root Cargo.toml [[bin]]
entries (jcode, test_api, jcode-harness, session_memory_bench,
memory_recall_bench) and the compile graph that produces them.
- A 'Where to read next' pointer table that links the most common
newcomer questions to the existing topic-specific docs and
crate lib.rs files.
- An 'Open documentation gaps' section that ties this map back to
the rest of the audit (rustdoc, examples) so the remaining work
is visible.
The descriptions of crates that lack both a Cargo.toml description
and a //! rustdoc are intentionally marked as inferred (a 'hint of
what they hold') rather than authoritative; a follow-up audit pass
to add //! lines to those 52 lib.rs files would make this map
derivable rather than hand-written.
tx-agent: jcode
tx-validated: manual
tx-task: top5-2026-10-17
tx-scope: ARCHITECTURE.md (new file)
tx-intent: add top-level ARCHITECTURE.md that maps the 92-crate workspace for newcomers
Add runnable `cargo run --example <name>` demos for the foundation crates identified in the J-docs audit as lacking examples: - jcode-app-core/examples/print_build_info.rs - jcode-config-types/examples/round_trip_enums.rs - jcode-core/examples/smoke.rs - jcode-herdr/examples/round_trip_state.rs - jcode-protocol/examples/serialize_history_message.rs - jcode-provider-core/examples/smoke.rs - jcode-swarm-core/examples/round_trip_enums.rs (adds serde_json dev-dep) - jcode-tool-core/examples/build_schema.rs Each example is 29-50 LOC, runs cleanly with `cargo run --example`, and demonstrates the crate's primary public API in a self-contained form. tx-agent: jcode tx-validated: manual tx-scope: 8 crates examples + swarm-core dev-dep tx-intent: resolve the J-docs top-5 'examples' gap tx-parent: 9e6d3de (rustdoc commit)
🤖 CodeAnt AI — Review Status
|
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 22 minutes. View limit details
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 |
| /// How a transcript message should be merged into the running | ||
| /// conversation history. | ||
| /// | ||
| /// Used by the protocol's inter-session handoff path so that a session | ||
| /// resuming from a snapshot can either | ||
| /// [`Insert`](TranscriptMode::Insert) at an arbitrary position, | ||
| /// [`Append`](TranscriptMode::Append) to the tail, | ||
| /// [`Replace`](TranscriptMode::Replace) a previous message (used for | ||
| /// stream rescans and mid-turn correction), or | ||
| /// [`Send`](TranscriptMode::Send) (default — leaves history | ||
| /// untouched and just transmits the new message). The wire form is | ||
| /// snake_case. |
There was a problem hiding this comment.
Suggestion: TranscriptMode controls how transcript text changes the TUI input buffer, not conversation history; this description could lead protocol clients to update the wrong state.
Assessment: 🟠 Major · 🔁 Occurrence: Sometimes · 🏷️ Docstring mismatch
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-protocol/src/lib.rs
**Line:** 32:43
**Comment:**
*Docstring Mismatch: `TranscriptMode` controls how transcript text changes the TUI input buffer, not conversation history; this description could lead protocol clients to update the wrong state.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix| /// - `field` is the JSON Schema for the input — the host must inspect | ||
| /// this (not the `intent`) to pick the right widget. |
There was a problem hiding this comment.
Suggestion: field is a form configuration object, not a JSON Schema; hosts following this contract may parse it incorrectly and fail to choose the right widget.
Assessment: 🟠 Major · 🔁 Occurrence: Rarely · 🏷️ Api mismatch
Prompt for AI Agent 🤖
This is a comment left during a code review.
**Path:** crates/jcode-tool-core/src/lib.rs
**Line:** 131:132
**Comment:**
*Api Mismatch: `field` is a form configuration object, not a JSON Schema; hosts following this contract may parse it incorrectly and fail to choose the right widget.
Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask user if the user wants to fix the rest of the comments as well. if said yes, then fetch all the comments validate the correctness and implement a minimal fix
CodeAnt Nitpicks13 code suggestions1.
|
CodeAnt PR Risk: Medium Risk
Assessed commit: |
…HITECTURE.md, 8 examples) (#114) Squash-merged from origin/docs/top5-2026-10-17. tx-agent: jcode tx-validated: manual tx-scope: docs/top5-2026-10-17 tx-intent: forward-path 2026-10-17 batch merge (top-5 docs) tx-pr: 114
|
Squash-merged into master via the forward-path 2026-10-17 batch (see commit on master). Closing as completed. |
…ash commits) 5 of 6 audited forward-path PRs squash-merged into master via the 2026-10-17 batch (security, PR94 blockers, cherry-picks, stdin, println, docs in priority order). 30 files / +2,900 / -78 LOC across the batch. Master pre-batch: 3f4746e Master post-batch: 521c66e Per-PR squash SHAs: #108 -> 827ff9d (cherry-pick from 17632a2b0) #109 -> 2f29ed0 (cherry-pick from 365d0a13a) #111 -> a1e19e5 (1 add/add conflict resolved: docs/GOOGLE_GUIDED_SETUP.md) #112 -> no-op (rustls patch already in master; PR closed) #113 -> 7fdbe2f (landed at cycle start; file-level cherry-pick of update_product.rs only) #114 -> 521c66e Source artifacts (canonical): phenotype-registry/audits/kcode-fork-forward-path-2026-10-17/ This directory: docs/audits/2026-10-17-forward-path-batch/ (HTML + PDF + README) tx-agent: jcode tx-validated: manual tx-scope: docs/audits/2026-10-17-forward-path-batch/ tx-intent: persist forward-path batch deliverables in source repo tx-pr: 115
…i-compatible) (#101) The README's 'Supported provider' section previously conflated the openai-compatible profile list (30+ named services) with native first-class provider integrations (11 adapter crates). This created a parity impression the code does not match — 'azure' was grouped with 'claude/openai' as 'Native / first-party' alongside genuine adapters, and 'cursor/antigravity' were lumped in with named profiles. This rewrites the section as a two-tier description: - 11 first-class adapter crates under crates/jcode-provider-*/ (anthropic, openai, gemini, copilot, openrouter, bedrock, antigravity, claude-cli, cursor, grok-build, forgecode) - the openai-compatible profile harness with its 30+ named built-ins, plus azure (jcode-azure-auth + openai-compat runtime) and the local/self-hosted set Reframes without removing the openai-compatible list. Heading becomes 'Provider surface' to match the new framing. Cherry-picked from origin/fix/e-readme-provider-count @ e83a596 (file-level only, KCode fork header from #114 preserved). Audit reference: E-usability.md, finding 'README's 40-provider claim sets false expectations.' tx-agent: jcode tx-validated: manual tx-scope: README.md tx-intent: stop the README from setting false expectations about provider count tx-pr: 101
|
|
Closing under the host-ops closure audit (2026-11-11): the same change already landed on master (matching commit subject); this PR is the leftover branch. The branch |



User description
Top-5 J-docs fixes (2026-10-17)
Audit-correction arc — addresses the top-5 doc gaps flagged in the J-docs audit.
5 commits, 5 fixes
6965beacd285428e5b9e6d3de37a1c89ccace70d9dc24Coverage
Cargo.tomlworkspace version.scripts/docs/build_env_table.pyfrom arg env::var(sweep across the workspace — 626 vars, 20 sections.Provider,SwarmRole,SwarmLifecycleStatus,CompactionMode,AgentMode,TranscriptMode,HistoryMessage,StdinInputRequest.cargo run --example, and demonstrate the crate's primary API.Verification
(Other 4 examples would also run; tested the canonical 4 on the build host.)
Notes
python3 scripts/docs/build_env_table.pyto refresh.serde_jsonas a dev-dep; that's the only Cargo change in the PR.🤖 Generated with the KCode agent swarm (raven lane).
CodeAnt-AI Description
Expand project documentation for setup, architecture, and crate APIs
What Changed
Impact
✅ Find the current release version✅ Look up environment variables in one reference✅ Try common crate APIs with runnable examples💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.