docs: dev-docs/ engineering knowledge base, slimmer CLAUDE.md, enforced Sui-pin consistency#1738
Merged
Merged
Conversation
…stency
Reorganize engineering documentation per current agentic-coding best
practice (Anthropic's Claude Code guidance: CLAUDE.md is loaded every
session, so it carries only always-applicable rules — "for each line,
ask: would removing this cause mistakes?"; bloat makes rules get lost.
Karpathy's context-engineering framing: agent-legible docs, copy-
pasteable commands, specs as the lever, knowledge compiled into a
persistent markdown base):
- dev-docs/ — the on-demand knowledge base (docs/ stays the website):
- specs/ relocated here unchanged (same maintenance rule, now
covering the whole folder);
- playbooks/: ci-suites (dispatchable workflows, runner facts,
artifact recovery), mpc-stall-postmortem (the check-ordered
diagnosis distilled from the wedge investigations), localnet
(version traps, readiness gates, fresh-ids trap);
- conventions/: sui-version-bump (every pin location + procedure),
simtest (moved from CLAUDE.md verbatim + run commands);
- learnings/pitfalls.md: failure CLASSES with the general rule each
taught (consensus determinism, batch-loop returns, silent skips,
eager backtraces, port races, poll-budget hierarchy, ...).
- CLAUDE.md slimmed 297 → 211 lines: the CI-suites and simtest deep
dives moved out behind one-line pointers (plain paths, not @imports —
imports inline into every session); specs section updated; new gotcha:
the Sui version (mainnet-v* or testnet-v*) is pinned in multiple
places and must be bumped everywhere in one PR.
- AGENTS.md → CLAUDE.md symlink (the cross-tool agent-instructions
standard; nearest-file-wins, supported by Codex/Cursor/Jules/Aider).
- scripts/check-sui-version-consistency.sh wired into the CI fmt job:
the single root-Cargo.toml Sui tag is the source of truth; the TS
workflows' binary downloads, CLAUDE.md, and any wasm-workspace pins
must match exactly (flavor included) or CI fails.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…repo skills and reviewer agent Second pass over CLAUDE.md per the same best-practice sources as the dev-docs reorg, this time converting advisory rules into enforcement and adding the pieces that load on demand instead of every session: - CLAUDE.md: add Karpathy's four working principles (think before coding, simplicity first, surgical changes, goal-driven execution); delete the six style rules clippy.toml already enforces (unbounded channels, block_on, deserialize_from, log macros, arg limit, struct-init shorthand) behind one meta-rule — mechanically-enforceable rules go in clippy.toml/lints, not here; merge near-duplicate lines; add a minimal-verification-by-change-type map and a compaction preservation instruction for long sessions. - Cargo.toml: `unsafe_code = "deny"` workspace lint — "NEVER use unsafe" as a compile error, not a request (workspace has zero unsafe). - .claude/ partially un-gitignored: project settings, subagents, hooks dir, and skills now ship with the repo (settings.local.json and worktrees stay personal; personal skills belong in ~/.claude/skills). - New repo skills: /dispatch-suites (fire the three heavy CI suites and triage by failure shape), /stall-postmortem (the ordered MPC-stall diagnosis as a command), /bump-sui (the full bump checklist). - New subagent: consensus-reviewer — six review lenses encoding the invariants real wedges taught (consensus determinism, epoch-close lock gating, batch-loop continues, no silent skips, parameter-set agreement, liveness symmetry). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Author
|
Second commit (
|
…rules PreToolUse[Bash] hook blocking (with an explanation, never modifying anything): any git command carrying the --no-verify flag, pushes targeting dev/main/master (word-boundary match — branch names merely containing those words pass), commits made while ON a protected branch, and commits including .rs files while the workspace rustfmt check is dirty. Flags and push targets are scanned on a reduced view of the command — cut at the first heredoc marker, quoted spans stripped — so a commit MESSAGE that mentions --no-verify or a protected-branch name cannot trip the guard (the unfixed version blocked its own introduction commit, which is also how the hook's liveness got verified end-to-end). Validated against 9 scenarios including refspec-form pushes, dev-substring branch names, and quoted/heredoc false-positive cases. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- plans/: implementation plans that outlive a session or span PRs, with an explicit status lifecycle (active/landed/superseded/abandoned); intent lives here, durable behavior moves to specs/ on landing, and code comments never reference plan phases. - reviews/: long-form PR/design/audit reviews as point-in-time records with per-finding resolution tracking; recurring findings get distilled into learnings/pitfalls.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
#4) The v4 pipeline's three designed halt/block modes are safety-first by design, so a blocked validator looks healthy from outside. The metrics all exist (verified against the registries); what was missing is the alerting contract: rules for ika_handoff_prepare_waiting (barrier blocked > 2x epoch) and off_chain_assembly_wedged (EverythingExcluded — the one mode with no self-heal), the log-based signal for the joiner bootstrap fail-closed halt, the operator action for each, and the secondary dashboard signals (pruner advancement, presign-queue drain, rejected handoff signatures). Also merges origin/dev (PRs #1734/#1735): git's rename detection carried the new adoption-guards section of specs/handoff.md into the relocated dev-docs/specs/handoff.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- ci-suites.md: test-cluster.yaml's test_filter is a nextest positional filter — it matches test FUNCTION names, not file stems (a file-stem filter silently runs 0 tests and fails with "no tests to run"). - pitfalls.md: an IkaNodeHandle holds a strong Arc<IkaNode>; holding one across its node's in-process restart keeps the RocksDB stores open and the respawn dies on "lock hold by current process". Acquire handles on demand, never across stop()/start(). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Reorganizes engineering documentation around how AI coding agents (and humans) actually consume it, applies current agentic-coding best practice to CLAUDE.md — converting advisory rules into deterministic enforcement wherever possible — and ships the on-demand tooling (skills, a reviewer subagent, a git-guard hook) that the always-loaded file should not carry.
The design, and the research behind it
@imports, which inline into every session).dev-docs/is the on-demand knowledge base (docs/remains the public website), structured per Karpathy's context-engineering framing (definition; agent-legible docs critique: "What is the thing I should copy-paste to my agent?") — playbooks lead with copy-pasteable commands; learnings are compiled into a persistent markdown base.unsafe_code = "deny"makes "NEVER use unsafe" a compile error, the Sui-pin rule gets a CI script, and the git rules get a PreToolUse hook.AGENTS.md→CLAUDE.mdsymlink per the agents.md cross-tool standard.dev-docs/ contents
CLAUDE.md changes
mainnet-v*ortestnet-v*— bump everywhere in one PR).Enforcement
scripts/check-sui-version-consistency.sh(wired into the CI Format job): the single root-Cargo.toml Sui tag is the source of truth; the TS workflows' binary-download URLs, CLAUDE.md, and any wasm-workspace pins must match exactly, flavor included.Cargo.toml:unsafe_code = "deny"workspace lint (workspace verified zero-unsafe; full CI build green)..claude/hooks/git-guard.sh(PreToolUse[Bash], wired in the checked-insettings.json): blocks-and-explains--no-verify, pushes targetingdev/main/master, commits made while ON a protected branch, and commits of.rsfiles with a dirty rustfmt check. Flags are scanned on a heredoc-cut, quote-stripped view of the command so commit messages mentioning them can't false-positive — a class found when the hook blocked its own introduction commit, which also verified its liveness end-to-end. Validated against 9 scenarios.Team-shared .claude/
.gitignorenow shipsagents/,hooks/,skills/, andsettings.json(personalsettings.local.json/worktreesstay ignored; personal skills belong in~/.claude/skills/):/dispatch-suites(fire the three heavy suites, triage by failure shape),/stall-postmortem(the ordered MPC-stall diagnosis as a command),/bump-sui(the full bump checklist, manual-invoke only).consensus-reviewer— six review lenses encoding the invariants real wedges taught: consensus determinism, epoch-close lock gating, batch-loop continues, no silent skips, parameter-set agreement, liveness symmetry.Notes for reviewers
dev-docs/specs/content is byte-identical to the oldspecs/(puregit mv).🤖 Generated with Claude Code