fix: real-usage bugs + end-to-end flow test harness#22
Conversation
Bug fixes (all verified with real binary from /tmp):
- BUG-001: quickstart relative-path crash — create_workspace now makes dest
absolute via current_dir().join() before passing to Transaction/WorkspaceRoot,
eliminating the double-prefix "my-app/my-app/programs/..." ENOENT.
- BUG-002: scaffold instruction/account/event/error required --program even
when workspace has exactly one program — resolve_program() now auto-detects
the single program and prints "note: using program X" to stderr.
- BUG-003: sunscreen learn list gave unknown topic list — added
Some("list") | None arm to route to list_topics().
Flow test harness (new):
- .claude/skills/sunscreen-flow-tests/ with scripts for three complete user
journeys: zero-to-NFT (18 assertions), zero-to-token (17), and
zero-to-smart-contract (17). flow-runner.sh orchestrates all three.
- .claude/agents/flow-test-runner.md — new specialist owning end-to-end flows.
- Updated offline-ci-owner, test-harness-orchestrator, e2e-qa-fixer, and
ux-flow-validator to require flow tests before marking any gate green.
390/390 unit tests pass. 52/52 flow assertions pass.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
PR changed again? Review this PR in Change Stack to compare snapshots and stay oriented. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📜 Recent review details🧰 Additional context used📓 Path-based instructions (2)src/**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
**/*.rs📄 CodeRabbit inference engine (AGENTS.md)
Files:
🧠 Learnings (36)📓 Common learnings📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.882ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.882ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.882ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T19:16:09.338ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
📚 Learning: 2026-06-02T22:58:57.757ZApplied to files:
📚 Learning: 2026-06-02T22:59:42.881ZApplied to files:
🔇 Additional comments (7)
📝 WalkthroughWalkthroughIntroduces an end-to-end flow test harness (runner + three journey scripts + skill/docs), mandates real-binary flow validation in CI, fixes three CLI onboarding bugs (path normalization, optional program auto-detect, learn list), and refactors doctor/toolchain repairs with a new NeedsInspection status and safer installer logic. ChangesEnd-to-End CLI Fixes and Flow Test Infrastructure
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
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 |
Analysis CompleteGenerated ECC bundle from 2 commits | Confidence: 50% View Pull Request #23Repository Profile
Changed Files (18)
Top hotspots
Top directories
Analysis Depth Readiness (evidence-backed, 36%)ECC Tools uses this to decide whether recommendations should stay at commit-history/setup guidance or expand into CI, security, harness, reference-set, AI-routing, and team backlog work.
Reference Set Readiness (1/7, 14%)
Likely Future Issues (5)
Suggested Follow-up Work (5)
Copy-ready bodies test: add CLI coverage for docs/site/src/reference/cli/doctor.md + src/cli/chain.rs ## Summary
- Add shell, CLI, or end-to-end coverage for the recently changed command surface.
## Why
- Backfill CLI coverage before another command-surface change lands on the touched paths.
## Touched paths
- `docs/site/src/reference/cli/doctor.md`
- `src/cli/chain.rs`
## Validation
- Add or extend shell, CLI, or end-to-end coverage for the changed command surface.
- Exercise the user-facing command invocation and expected exit/output behavior.security: add scanner evidence for .claude/agents/e2e-qa-fixer.md + .claude/agents/flow-test-runner.md ## Summary
- Add security scanner or code-scanning evidence for the recently changed security-sensitive surface.
## Why
- Backfill explicit scanner or code-scanning evidence before another security-sensitive change lands on the touched surface.
## Touched paths
- `.claude/agents/e2e-qa-fixer.md`
- `.claude/agents/flow-test-runner.md`
## Validation
- Run or add the relevant security scanner, code scanning, secret scanning, or dependency/security review check for the touched surface.
- Attach the scanner output, SARIF/code-scanning result, or focused security regression test to the follow-up PR.
- Confirm the changed auth, billing, webhook, secret-handling, agent, or CI surface has an explicit pass/fail gate.test: add budget evidence for CLAUDE.md ## Summary
- Add budget or usage-limit validation for the recently changed AI routing or model-call surface.
## Why
- Backfill cost, token, or usage-limit validation before another model-routing change lands on the touched surface.
## Touched paths
- `CLAUDE.md`
## Validation
- Add or extend budget, token, usage-limit, or model-routing regression coverage for the changed path.
- Verify the route still enforces plan limits, retry caps, fallback behavior, or explicit cost controls.analysis: add reference-set evidence for .claude/agents/e2e-qa-fixer.md + .claude/agents/flow-test-runner.md ## Summary
- Add reference-set or eval evidence for the recently changed AI, analyzer, skill, agent, command, or harness guidance surface.
## Why
- Backfill eval, golden trace, benchmark, or reference-set evidence before another AI or harness-analysis change lands on the touched surface.
## Touched paths
- `.claude/agents/e2e-qa-fixer.md`
- `.claude/agents/flow-test-runner.md`
## Validation
- Add or update an eval, golden trace, benchmark, fixture, or reference-set artifact for the changed AI/harness behavior.
- Compare the changed behavior against the maintained reference set and record the pass/fail evidence.
- Confirm the follow-up evidence covers the same analyzer, skill, agent, command, or harness surface touched by this PR.harness: add config quality evidence for .claude/agents/e2e-qa-fixer.md + .claude/agents/flow-test-runner.md ## Summary
- Add harness compatibility evidence for the recently changed config surface.
## Why
- Backfill harness audit, adapter matrix, or cross-harness compatibility evidence before another config change lands on the touched surface.
## Touched paths
- `.claude/agents/e2e-qa-fixer.md`
- `.claude/agents/flow-test-runner.md`
## Validation
- Run or update the harness audit, adapter compliance matrix, or cross-harness compatibility check for the changed config.
- Add or update a regression, fixture, or doc evidence path that covers the affected harness, MCP, plugin, or agent loading behavior.Generated Instincts (14)
After merging, import with: Files
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 49c8e133e1
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| assert_cmd 0 "doctor exits 0 (reports tool status)" \ | ||
| "$SUNSCREEN_BIN" doctor || true # doctor may exit non-zero if tools missing — accept both |
There was a problem hiding this comment.
Accept doctor exit 2 in offline flows
On a normal offline developer/CI machine where required tools like Anchor or Solana are missing, sunscreen doctor exits 2 (per src/cli/doctor.rs), and SUNSCREEN_SKIP_PREFLIGHT does not change doctor detection. This assert_cmd 0 records a failure before the trailing || true can help, so the mandatory flow-runner.sh will fail the zero-to-NFT flow even though the comment says missing tools should be accepted; the doctor step needs to explicitly allow the missing-tool exit code.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Actionable comments posted: 10
🤖 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 @.claude/agents/e2e-qa-fixer.md:
- Around line 67-75: Add a language tag to the Markdown code fence that contains
the FLOW block (the triple-backtick fence before "FLOW: zero-to-NFT") so it
satisfies markdownlint MD040; e.g., change ``` to ```text or ```bash to make the
fence language-specified while preserving the block content ("FLOW:
zero-to-NFT", "STEP: scaffold instruction mint", etc.).
In @.claude/agents/flow-test-runner.md:
- Around line 83-92: The fenced bug-report block starting with ``` (the FLOW:
zero-to-NFT ... EXIT: 1 ...) is missing a language tag (markdownlint MD040);
edit the block in .claude/agents/flow-test-runner.md so the opening fence
includes an appropriate language identifier (for example ```text or ```console)
to satisfy the linter and preserve the block contents unchanged.
- Around line 28-29: Update the step text "Run build (expect exit 0 with real
Anchor, exit 2 without)" to list all accepted offline build exit codes (0, 1,
and 2) so documentation matches the implemented smart-contract flow; reference
the smart-contract test script flow-smart-contract.sh to ensure the wording
mirrors the actual accepted outcomes and avoid suggesting only exit 2 for
offline runs.
In @.claude/agents/test-harness-orchestrator.md:
- Around line 31-35: The fenced bash code block using the delimiter "```bash"
needs blank lines immediately before and after the fence to satisfy markdownlint
MD031; update the markdown around the existing "```bash" block (the
three-backtick fence and its closing fence) by inserting a blank line above the
opening fence and a blank line below the closing fence so the block is separated
from surrounding text.
In @.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh:
- Around line 102-104: The test is asserting duplicate scaffolding returns exit
0 but the validator contract requires exit 4 for user-input conflicts; update
the assertion in the scaffold duplicate test so assert_cmd expects exit code 4
(change the description text from "exit 0 (idempotent no-op)" to "exit 4
(user_input conflict)" and the call that runs "$SUNSCREEN_BIN scaffold
instruction mint" to assert exit 4 instead of 0) so the flow aligns with the
standardized exit-code policy.
- Around line 117-119: The issue is that the assert_cmd assertion is set to
expect exit code 0, but the || true at the end only prevents the shell from
exiting early - it does not prevent the assert_cmd function from incrementing
the FAIL counter when doctor actually exits with code 1. To fix this, modify the
assertion to explicitly handle both valid outcomes: instead of using assert_cmd
with a single expected exit code followed by || true, capture the exit code from
the doctor command execution and then assert that the exit code is either 0 or 1
(both are acceptable), ensuring the assertion logic accepts both possible valid
outcomes rather than relying on || true to suppress the failure.
In @.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh:
- Around line 119-134: The test currently runs "$SUNSCREEN_BIN chain build
--headless" and claims NDJSON was validated but never requests JSON or checks
event shape; change the invocation to request NDJSON output (add the CLI flag
that emits NDJSON, e.g., --json or the tool's NDJSON flag) when calling chain
build (the line assigning output using "$SUNSCREEN_BIN" chain build --headless)
and then parse/validate the output stored in output to ensure each line is valid
JSON and matches expected event keys (e.g., check for required fields used
elsewhere in the flow); keep using build_exit for allowed codes (0,1,2) but
after the exit check add a lightweight NDJSON validation step that fails the
test if any line is not valid JSON or missing required event-shape fields.
- Line 149: The command invoking "$SUNSCREEN_BIN" doctor uses the wrong
redirection order so stderr still appears; update the invocation that sets
dr_exit (the line using "$SUNSCREEN_BIN" doctor 2>&1 >/dev/null || dr_exit=$?)
to redirect stdout then stderr (i.e., use > /dev/null 2>&1) so both stdout and
stderr are suppressed and dr_exit still captures the exit code.
In @.claude/skills/sunscreen-flow-tests/scripts/flow-token.sh:
- Line 18: The current trap unconditionally removes the FLOW_DIR on EXIT; change
it to a conditional cleanup that only deletes FLOW_DIR when the script exits
successfully and preserves it on failure for debugging. Replace the simple trap
'rm -rf "$FLOW_DIR"' with a cleanup handler invoked on EXIT that checks the exit
status ($?) and calls rm -rf "$FLOW_DIR" only if the status is zero, otherwise
prints/logs that FLOW_DIR is preserved (reference FLOW_DIR and the trap/EXIT
handler).
In `@src/toolchain/fix.rs`:
- Around line 328-331: The passed shell args to the rustup installer include an
unnecessary "-s -- -y"; update the call to download_then_run_shell so the
installer is invoked with only "-y" (i.e., replace the argument string "-s --
-y" with "-y") in the FixStep::shell invocation that launches the rustup script
so the script receives a single "-y" argument.
🪄 Autofix (Beta)
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: ASSERTIVE
Plan: Pro
Run ID: 413a0e2b-a6b9-4184-a904-2ac8793c0928
📒 Files selected for processing (18)
.claude/agents/e2e-qa-fixer.md.claude/agents/flow-test-runner.md.claude/agents/offline-ci-owner.md.claude/agents/test-harness-orchestrator.md.claude/agents/ux-flow-validator.md.claude/skills/sunscreen-flow-tests/SKILL.md.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh.claude/skills/sunscreen-flow-tests/scripts/flow-runner.sh.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh.claude/skills/sunscreen-flow-tests/scripts/flow-token.shCLAUDE.mddocs/site/src/reference/cli/doctor.mdsrc/cli/chain.rssrc/cli/doctor.rssrc/cli/scaffold.rssrc/onboarding/learn.rssrc/toolchain/fix.rstests/doctor_fix.rs
📜 Review details
🧰 Additional context used
📓 Path-based instructions (6)
src/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
For real-world testing, heavy integration, real toolchains, end-to-end QA, release QA, flake/perf work, or proving the app works, invoke
sunscreen-test-harnessthrough the orchestrator rather than implementing tests inline
Files:
src/onboarding/learn.rssrc/cli/chain.rssrc/cli/doctor.rssrc/toolchain/fix.rssrc/cli/scaffold.rs
**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Preserve strategic decisions from ADR-0001 (Anchor IDL as source of truth, marker-based editing, plugin protocol) while adapting all stack references from Go/solis to Rust/sunscreen (clap, serde, minijinja, rust-embed, tokio, insta)
Use Rust (clap, serde, minijinja, rust-embed, tokio, insta) for sunscreen CLI implementation instead of Go/solis stack
Preserve strategic decisions from ADR (Anchor IDL as source of truth, marker-based editing, plugin protocol) when translating from Go to Rust
Use exit codes consistently: 0 for success, 2 for toolchain_missing, 3 for invalid config, 4 for user_input/ambiguity/conflict, 5 for workspace_missing, 9 for plugin_runtime errors
Implement --dry-run and --json flags for scaffolding and generation commands to enable idempotent, machine-readable operations
Ensure all scaffolding operations are idempotent and include drift detection to warn users when manual changes conflict with re-scaffolding
Use marker-based editing (segments like 'dispatch', 'instructions', 'error_variants') in generated template files for safe, non-destructive code insertion
Run fmt and clippy checks on all generated code; generated workspaces must pass
cargo checkandcargo fmt --checkGate compile coverage for onboarding-specific tests with cfg(feature = "onboarding") to ensure cargo test --no-default-features passes
Files:
src/onboarding/learn.rssrc/cli/chain.rstests/doctor_fix.rssrc/cli/doctor.rssrc/toolchain/fix.rssrc/cli/scaffold.rs
src/cli/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
CLI command implementations in sunscreen must invoke the
sunscreen-orchestratorskill for any request to implement, expand, fix, or refactor CLI featuresUse CommandSpec and ProcessRunner abstraction for subprocess orchestration to enable testable runtime boundaries without direct shell invocation
Files:
src/cli/chain.rssrc/cli/doctor.rssrc/cli/scaffold.rs
src/cli/chain.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/cli/chain.rs:chain newmust create Anchor workspaces withsegment=dispatchinlib.rsandsegment=instructionsininstructions/mod.rstemplates; firstscaffold instructionpatches without warning (lib_rs_patched=true)
chain doctor --fix-markersmust repair safe non-appendable sites without appending invalid Rust;dispatchis rebuilt only when generated wrappers are gone and instruction files definepub fn handler, anderror_variantsmarker insertion refuses ambiguous enum bodies
chain build --headlessmust discover the workspace, runanchor build, emit NDJSON events, report missing Anchor as exit 2, and preserve Anchor failure exit codes; followed bypnpm exec codama runby default unless--no-codamais set
chain serve --headlessmust start anotifywatcher, batch relevant changes through debounce, emit NDJSON for watcher-triggered build pipeline runs, and launch managed Surfpool/test-validator runtime with fallback from implicit Surfpool to test-validator
Files:
src/cli/chain.rs
tests/**/*.rs
📄 CodeRabbit inference engine (AGENTS.md)
Unit and integration tests must remain in-repo (offline deterministic gate, generated workspace compile gate, real Anchor/Solana/Codama gate, real Pinocchio SBF, serve runtime, plugin runtime, frontend typecheck tests); heavy/real-world testing is delegated to
sunscreen-test-harnessMaintain insta snapshots (golden/render_* files) for all code generation outputs; update snapshots when output changes are intentional
Include offline deterministic tests, compile tests (cargo check over generated workspaces), and rustfmt round-trip tests as mandatory gates before release
Create isolated fake-toolchain tests for onboarding and CLI integration; use the compiled binary from /tmp with isolated temp dirs for end-to-end flow tests
Files:
tests/doctor_fix.rs
src/cli/scaffold.rs
📄 CodeRabbit inference engine (AGENTS.md)
src/cli/scaffold.rs: All scaffold subcommands (instruction, account, event, error, program) must support--dry-runand--jsonflags, return exit code 4 on user_input conflicts, and include generator tag on every marker (instruction/account/event/error/program)
Scaffold subcommands must fail clearly when Anchor-only features are invoked in non-Anchor frameworks (e.g., Pinocchio); accept--framework pinocchioparameter where applicable
Files:
src/cli/scaffold.rs
🧠 Learnings (48)
📓 Common learnings
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/**/*.rs : For real-world testing, heavy integration, real toolchains, end-to-end QA, release QA, flake/perf work, or proving the app works, invoke `sunscreen-test-harness` through the orchestrator rather than implementing tests inline
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to tests/**/*.rs : Unit and integration tests must remain in-repo (offline deterministic gate, generated workspace compile gate, real Anchor/Solana/Codama gate, real Pinocchio SBF, serve runtime, plugin runtime, frontend typecheck tests); heavy/real-world testing is delegated to `sunscreen-test-harness`
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.882Z
Learning: Sunscreen v1.0 is scoped to: Phase 0 (CLI scaffolding), Phase 1 (workspace bootstrap), Phase 2 (instruction/account/event/error/program scaffolders), Phase 3 (dev loop—build/serve/watcher), Phase 4 (codegen—clients/IDL/hooks), Phase 5 (recipes—CRUD/SPL-Token/Metaplex), Phase 5.5 (onboarding—init/examples/quickstart/wallet/deploy/learn), Phase 6 (plugin system), Phase 7 (Pinocchio support), Phase 8 (distribution/docs); total effort ~21 weeks
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/cli/onboarding/**/*.rs : Onboarding commands (init, examples, quickstart, wallet, deploy, learn, next_step) must support offline and fake-toolchain testing
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/**/*.rs : CLI command implementations in sunscreen must invoke the `sunscreen-orchestrator` skill for any request to implement, expand, fix, or refactor CLI features
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Invoke sunscreen-orchestrator skill for any request to implement, expand, fix, or refactor the sunscreen CLI
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Invoke sunscreen-test-harness through orchestrator for real-world testing, heavy integration, real toolchains, end-to-end QA, release QA, and flake/perf work
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Invoke sunscreen-publisher skill for publish release, distribute via homebrew/snap/apt, expand release pipeline, or configure brew tap / snapcraft / cargo-deb / cloudsmith requests
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Invoke sunscreen-docs-orchestrator skill for requests related to docs, site, tutorials, GitHub Pages, or Phase 8 docs; keep docs-writer agent for ADR-only responsibility
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Answer conceptual questions about Solana/Anchor directly without invoking orchestrator; only invoke orchestrator for implementation requests
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Preserve Anchor failure exit codes in chain build output; report missing Anchor as exit 2 and missing pnpm as toolchain_missing
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Design plugin contract with: runtime manager, tonic gRPC, stdio JSON-RPC, sandbox/trust model, marketplace/local plugins, and reference plugins (spl-token-2022, yellowstone-indexer)
Learnt from: CR
Repo: Pantani/sunscreen
Timestamp: 2026-06-06T04:50:57.010Z
Learning: Run the full end-to-end flow test harness (zero-to-NFT, zero-to-token, zero-to-smart-contract) in every test round and every fix cycle with 52+ assertions
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to tests/**/*.rs : Unit and integration tests must remain in-repo (offline deterministic gate, generated workspace compile gate, real Anchor/Solana/Codama gate, real Pinocchio SBF, serve runtime, plugin runtime, frontend typecheck tests); heavy/real-world testing is delegated to `sunscreen-test-harness`
Applied to files:
.claude/agents/offline-ci-owner.md.claude/agents/e2e-qa-fixer.md.claude/skills/sunscreen-flow-tests/scripts/flow-token.sh.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh.claude/skills/sunscreen-flow-tests/scripts/flow-runner.sh.claude/agents/test-harness-orchestrator.md.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/ux-flow-validator.mdCLAUDE.md.claude/agents/flow-test-runner.mdtests/doctor_fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to .github/workflows/ci.yml : CI must enforce `--locked` and no-default-features builds, run command-group smoke tests with compiled binary and isolated fake toolchains, enforce concurrency limits, permissions checks, and timeouts
Applied to files:
.claude/agents/offline-ci-owner.md.claude/agents/e2e-qa-fixer.md.claude/agents/test-harness-orchestrator.md.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/ux-flow-validator.md.claude/agents/flow-test-runner.md
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/**/*.rs : For real-world testing, heavy integration, real toolchains, end-to-end QA, release QA, flake/perf work, or proving the app works, invoke `sunscreen-test-harness` through the orchestrator rather than implementing tests inline
Applied to files:
.claude/agents/offline-ci-owner.md.claude/agents/e2e-qa-fixer.md.claude/skills/sunscreen-flow-tests/scripts/flow-token.sh.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh.claude/skills/sunscreen-flow-tests/scripts/flow-runner.sh.claude/agents/test-harness-orchestrator.md.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/ux-flow-validator.mdCLAUDE.md.claude/agents/flow-test-runner.mdtests/doctor_fix.rssrc/toolchain/fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to tests/*integration*.rs : Integration tests must use isolated fake toolchains and run the compiled binary explicitly, not internal APIs, to validate end-to-end CLI behavior
Applied to files:
.claude/agents/offline-ci-owner.md.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh.claude/agents/test-harness-orchestrator.md.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/ux-flow-validator.md.claude/agents/flow-test-runner.mdtests/doctor_fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/cli/onboarding/**/*.rs : Onboarding commands (init, examples, quickstart, wallet, deploy, learn, next_step) must support offline and fake-toolchain testing
Applied to files:
.claude/agents/offline-ci-owner.md.claude/agents/e2e-qa-fixer.md.claude/skills/sunscreen-flow-tests/scripts/flow-token.sh.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh.claude/agents/test-harness-orchestrator.md.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/ux-flow-validator.md.claude/agents/flow-test-runner.mdtests/doctor_fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/toolchain/preflight.rs : Preflight checks must skip Anchor when `--framework pinocchio` is used; `chain build` must emit `pinocchio_build` and run `cargo build-sbf` for Pinocchio workspaces
Applied to files:
.claude/agents/offline-ci-owner.mdtests/doctor_fix.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/cli/onboarding/*.rs : Onboarding commands (`init`, `examples`, `quickstart`, `wallet`, `deploy`, `learn`) must work offline or with fake toolchain substitutes for testing
Applied to files:
.claude/agents/offline-ci-owner.md.claude/agents/e2e-qa-fixer.md.claude/skills/sunscreen-flow-tests/scripts/flow-token.sh.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/ux-flow-validator.md.claude/agents/flow-test-runner.mdtests/doctor_fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/runtime/pipeline.rs : Build pipeline must run anchor build followed by pnpm exec codama run with --no-codama skip option
Applied to files:
.claude/agents/offline-ci-owner.md.claude/agents/flow-test-runner.md
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/chain.rs : `chain build --headless` must discover the workspace, run `anchor build`, emit NDJSON events, report missing Anchor as exit 2, and preserve Anchor failure exit codes; followed by `pnpm exec codama run` by default unless `--no-codama` is set
Applied to files:
.claude/agents/offline-ci-owner.md.claude/skills/sunscreen-flow-tests/scripts/flow-nft.sh.claude/agents/test-harness-orchestrator.mdsrc/cli/chain.rs.claude/agents/flow-test-runner.mdtests/doctor_fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.shsrc/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to tests/**/*.rs : Compile tests should validate generated Rust workspaces with `cargo check` to ensure syntactic correctness
Applied to files:
.claude/agents/offline-ci-owner.mdtests/doctor_fix.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to docs/adr/ADR-0001-solis-cli.md : The ADR is the design source of truth but references Go/solis; all stack references must be adapted to Rust/sunscreen for this project
Applied to files:
.claude/agents/e2e-qa-fixer.md.claude/skills/sunscreen-flow-tests/SKILL.mddocs/site/src/reference/cli/doctor.md.claude/agents/flow-test-runner.md
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to **/*.rs : Preserve strategic decisions from ADR-0001 (Anchor IDL as source of truth, marker-based editing, plugin protocol) while adapting all stack references from Go/solis to Rust/sunscreen (clap, serde, minijinja, rust-embed, tokio, insta)
Applied to files:
.claude/agents/e2e-qa-fixer.md.claude/agents/test-harness-orchestrator.mdCLAUDE.mdtests/doctor_fix.rssrc/cli/doctor.rssrc/toolchain/fix.rssrc/cli/scaffold.rs
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/**/*.rs : CLI command implementations in sunscreen must invoke the `sunscreen-orchestrator` skill for any request to implement, expand, fix, or refactor CLI features
Applied to files:
.claude/agents/e2e-qa-fixer.md.claude/skills/sunscreen-flow-tests/SKILL.mddocs/site/src/reference/cli/doctor.mdsrc/cli/doctor.rssrc/toolchain/fix.rssrc/cli/scaffold.rs
📚 Learning: 2026-06-02T22:59:42.882Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.882Z
Learning: Sunscreen v1.0 is scoped to: Phase 0 (CLI scaffolding), Phase 1 (workspace bootstrap), Phase 2 (instruction/account/event/error/program scaffolders), Phase 3 (dev loop—build/serve/watcher), Phase 4 (codegen—clients/IDL/hooks), Phase 5 (recipes—CRUD/SPL-Token/Metaplex), Phase 5.5 (onboarding—init/examples/quickstart/wallet/deploy/learn), Phase 6 (plugin system), Phase 7 (Pinocchio support), Phase 8 (distribution/docs); total effort ~21 weeks
Applied to files:
.claude/agents/e2e-qa-fixer.md.claude/skills/sunscreen-flow-tests/SKILL.mddocs/site/src/reference/cli/doctor.mdCLAUDE.md
📚 Learning: 2026-06-02T22:59:42.882Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.882Z
Learning: The dev loop is orchestrated end-to-end: `chain new` → `chain serve` (watcher + build + Codama + frontend notify) → `generate` (clients/IDL/hooks) → `scaffold recipes` → `app` (plugin lifecycle) → deployment via `deploy` command
Applied to files:
.claude/agents/test-harness-orchestrator.md
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to tests/integration_*.rs : Integration tests must use Ignite-style CLI smoke tests with isolated fake toolchains and compiled binary invocation
Applied to files:
.claude/skills/sunscreen-flow-tests/SKILL.md
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to tests/**/*.rs : Test files must be comprehensive and deterministic; golden snapshots required for complex output
Applied to files:
.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/flow-test-runner.md
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to tests/**/*.rs : All generated workspace snapshots must be committed to `tests/golden/` and validated with `insta` for regression detection
Applied to files:
.claude/skills/sunscreen-flow-tests/SKILL.md.claude/agents/flow-test-runner.md
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to tests/golden/**/*.rs : Golden snapshot tests (using `insta`) must validate generated workspace rendering, markers, and compile output; snapshots must be updated and committed with their corresponding source changes
Applied to files:
.claude/agents/ux-flow-validator.md
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/chain.rs : `chain new` must create Anchor workspaces with `segment=dispatch` in `lib.rs` and `segment=instructions` in `instructions/mod.rs` templates; first `scaffold instruction` patches without warning (`lib_rs_patched=true`)
Applied to files:
src/cli/chain.rssrc/cli/scaffold.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/config/loader.rs : Workspace discovery must locate sunscreen.yml config at the root and fail with clear messages if missing
Applied to files:
src/cli/chain.rssrc/cli/scaffold.rs
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/chain.rs : `chain doctor --fix-markers` must repair safe non-appendable sites without appending invalid Rust; `dispatch` is rebuilt only when generated wrappers are gone and instruction files define `pub fn handler`, and `error_variants` marker insertion refuses ambiguous enum bodies
Applied to files:
src/cli/chain.rstests/doctor_fix.rssrc/cli/doctor.rssrc/toolchain/fix.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to tests/**/*.rs : All workspace-creating tests should use isolated temporary directories and clean up after themselves to avoid test coupling
Applied to files:
src/cli/chain.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/cli/chain.rs : `chain build` must run Anchor then Codama by default, support `--no-codama` to skip regeneration, and preserve Anchor exit codes on failure
Applied to files:
src/cli/chain.rstests/doctor_fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to .github/workflows/release.yml : Release workflow must use `cargo-dist` for tag-driven distribution, generate Linux/macOS archives and shell installer, enforce SemVer preview policy for pre-release versions, and publish to GitHub Releases
Applied to files:
CLAUDE.md
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/cli/chain.rs : `chain doctor --fix-markers` must repair safe non-appendable sites without appending invalid Rust and refuse ambiguous enum bodies in marker insertion
Applied to files:
tests/doctor_fix.rssrc/cli/doctor.rssrc/toolchain/fix.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/cli/chain.rs : Chain doctor must repair markers safely without appending invalid Rust; non-appendable sites must be rebuilt only when constraints are met
Applied to files:
tests/doctor_fix.rssrc/toolchain/fix.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/toolchain/*.rs : Toolchain detection must support framework-specific preflight checks (Anchor for most scaffolds, no Anchor for Pinocchio) and report missing tools with exit code 2
Applied to files:
tests/doctor_fix.rssrc/cli/doctor.rssrc/toolchain/fix.rs.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/toolchain/preflight.rs : Preflight checks must skip Anchor for non-Anchor frameworks (e.g., Pinocchio)
Applied to files:
tests/doctor_fix.rs
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/scaffold.rs : Scaffold subcommands must fail clearly when Anchor-only features are invoked in non-Anchor frameworks (e.g., Pinocchio); accept `--framework pinocchio` parameter where applicable
Applied to files:
tests/doctor_fix.rssrc/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/cli/*.rs : Commands should use exit code 4 (`user_input`) for conflicts or ambiguities requiring user intervention, exit code 2 (`toolchain_missing`) for missing tools, and exit code 3 (`config_invalid`) for configuration errors
Applied to files:
src/cli/doctor.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/cli/**/*.rs : Exit codes must follow the convention: 0=success, 2=toolchain_missing, 3=invalid_config, 4=user_input, 5=workspace_missing, 9=plugin_runtime
Applied to files:
src/cli/doctor.rs
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/app.rs : `app` lifecycle commands (install, uninstall, list, describe, update) must manage declarative `plugins[]` entries with idempotent install, `--dry-run` support, basename normalization, semver validation with optional `v` prefix, and duplicate-source detection; exit codes reuse 3/4/5
Applied to files:
src/toolchain/fix.rssrc/cli/scaffold.rs
📚 Learning: 2026-06-02T22:59:42.882Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.882Z
Learning: Exit codes are standardized: 0 (success), 1 (unhandled error), 2 (toolchain error—missing Anchor/Solana), 3 (invalid config), 4 (user input conflict), 5 (workspace state error), 9 (plugin runtime error)
Applied to files:
.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
📚 Learning: 2026-06-02T22:59:42.881Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: AGENTS.md:0-0
Timestamp: 2026-06-02T22:59:42.881Z
Learning: Applies to src/cli/scaffold.rs : All scaffold subcommands (instruction, account, event, error, program) must support `--dry-run` and `--json` flags, return exit code 4 on user_input conflicts, and include generator tag on every marker (instruction/account/event/error/program)
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/scaffold/**/*.rs : Implement idempotency for all scaffolding commands (scaffold instruction/account/event/error/program/recipes)
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/scaffold/**/*.rs : Scaffold commands must support --dry-run flag for preview without side effects
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/scaffold/*.rs : Scaffold operations must support `--dry-run` and `--json` flags for preview and machine-readable output
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/cli/scaffold.rs : Scaffold command conflicts (e.g., duplicate account definitions) should return exit code 4 with a clear error message identifying the conflict
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/scaffold/*.rs : Composite recipe scaffolds (CRUD, SPL-Token, Metaplex NFT) must compose Phase 2 primitives (program, instruction, account, event, error) and support optional frontend recipe hooks
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/error.rs : All error types must include actionable messages and context; PathConflict and Network errors must guide users
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/**/*.rs : All error types must implement `std::error::Error` and use structured error variants with actionable messages for end users
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/cli/app.rs : Plugin installation must be idempotent, support `--dry-run`, validate semver (with optional `v` prefix), detect duplicate sources, and normalize plugin names from git URLs
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T19:16:09.338Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T19:16:09.338Z
Learning: Applies to src/cli/*.rs : CLI commands should emit NDJSON (newline-delimited JSON) events for long-running operations like build, serve, and watch to support machine-readable progress
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/cli/**/*.rs : CLI commands must emit NDJSON events for streaming/logging in headless/automated contexts
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/cli/scaffold.rs : Plugin-backed scaffolders must invoke plugin run hook with noun and optional json argument
Applied to files:
src/cli/scaffold.rs
📚 Learning: 2026-06-02T22:58:57.757Z
Learnt from: CR
Repo: Pantani/sunscreen PR: 0
File: CLAUDE.md:0-0
Timestamp: 2026-06-02T22:58:57.757Z
Learning: Applies to src/runtime/pipeline.rs : Pinocchio build must run cargo build-sbf and emit pinocchio_build event instead of anchor build
Applied to files:
src/cli/scaffold.rs
🪛 LanguageTool
.claude/agents/test-harness-orchestrator.md
[style] ~42-~42: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...teardown. - frontend-codegen-owner for frontend typecheck. 7. Dispatch `plugin...
(ENGLISH_WORD_REPEAT_BEGINNING_RULE)
.claude/skills/sunscreen-flow-tests/SKILL.md
[style] ~93-~93: The double modal “requires funded” is nonstandard (only accepted in certain dialects). Consider “to be funded”.
Context: ...-owner`) - Real Solana deploy (requires funded wallet + network — outside offline scop...
(NEEDS_FIXED)
🪛 markdownlint-cli2 (0.22.1)
.claude/agents/e2e-qa-fixer.md
[warning] 22-22: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 67-67: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
.claude/agents/test-harness-orchestrator.md
[warning] 31-31: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 35-35: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 48-48: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
.claude/skills/sunscreen-flow-tests/SKILL.md
[warning] 22-22: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
.claude/agents/ux-flow-validator.md
[warning] 37-37: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 41-41: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 47-47: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 55-55: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 60-60: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 66-66: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 73-73: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 81-81: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 81-81: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
.claude/agents/flow-test-runner.md
[warning] 45-45: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 46-46: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 48-48: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 51-51: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 52-52: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 54-54: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 57-57: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 58-58: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 64-64: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 67-67: Headings should be surrounded by blank lines
Expected: 1; Actual: 0; Below
(MD022, blanks-around-headings)
[warning] 68-68: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 83-83: Fenced code blocks should be surrounded by blank lines
(MD031, blanks-around-fences)
[warning] 83-83: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
🪛 Shellcheck (0.11.0)
.claude/skills/sunscreen-flow-tests/scripts/flow-smart-contract.sh
[warning] 149-149: To redirect stdout+stderr, 2>&1 must be last (or use '{ cmd > file; } 2>&1' to clarify).
(SC2069)
🔇 Additional comments (8)
CLAUDE.md (1)
62-63: LGTM!src/cli/chain.rs (1)
589-599: LGTM!src/cli/scaffold.rs (1)
126-129: LGTM!Also applies to: 142-145, 158-160, 174-177, 433-434, 445-446, 457-458, 474-475, 693-697, 863-864, 915-916, 935-936, 1439-1463, 1570-1573, 1684-1685, 1718-1719, 1842-1845, 1945-1946, 1976-1977, 2162-2166, 2253-2254, 2284-2285
src/onboarding/learn.rs (1)
49-50: LGTM!src/cli/doctor.rs (1)
96-103: LGTM!Also applies to: 226-227, 321-323
docs/site/src/reference/cli/doctor.md (1)
44-47: LGTM!tests/doctor_fix.rs (1)
113-155: LGTM!Also applies to: 223-255
.claude/skills/sunscreen-flow-tests/scripts/flow-runner.sh (1)
1-48: LGTM!
… cleanup trap, markdown lints - flow-nft.sh: accept doctor exit 0/1/2 in offline flows (|| true did not protect FAIL counter) - flow-nft.sh: clarify idempotency comment (same-content → exit 0, not 4) - flow-smart-contract.sh: add NDJSON contract check for chain_build_started/finished events - flow-smart-contract.sh: fix redirect order 2>&1 >/dev/null → >/dev/null 2>&1 (SC2069) - flow-smart-contract.sh: accept doctor exit 2 (missing tools) as valid offline outcome - flow-token.sh: preserve FLOW_DIR on failure for debugging instead of unconditional cleanup - fix.rs: remove redundant -s from rustup installer args (use -y only) - e2e-qa-fixer.md, flow-test-runner.md: add language tag to bare code fences (MD040) - flow-test-runner.md: align offline build exit docs with implemented behavior (exit 0/1/2) - test-harness-orchestrator.md: add blank lines around fenced block (MD031)
Summary
Three CLI bugs that only appeared in real usage (integration tests were green) plus a new flow test harness to prevent regressions.
Bug fixes
BUG-001 (
src/cli/chain.rs):sunscreen quickstart nft --name Xcrashed with ENOENT after creating the workspace. Root cause:create_workspacereturned a relativePathBufwhichTransactionthen joined with an already-relative sub-path, producing"my-app/my-app/programs/...". Fix: makedestabsolute viacurrent_dir().join()before any downstream use.BUG-002 (
src/cli/scaffold.rs):scaffold instruction/account/event/errorrequired--programeven when the workspace had exactly one program. Fix: changed all fourArgsstructs fromprogram: Stringtoprogram: Option<String>and addedresolve_program()which auto-detects the single program (printsnote: using program \X``) or gives a clear error when 2+ programs exist.BUG-003 (
src/onboarding/learn.rs):sunscreen learn listgave"unknown learn topic 'list'". Fix: addedSome("list") | None => list_topics(json)arm beforeSome(topic).Flow test harness (new)
Complete end-to-end user-journey scripts that run the real compiled binary from an isolated
/tmpdirectory — the only way to catch path bugs and auto-detection failures that unit tests cannot see:flow-nft.shflow-token.shflow-smart-contract.shflow-runner.shNew
flow-test-runneragent owns these flows and is now mandatory in every test round.offline-ci-owner,test-harness-orchestrator,e2e-qa-fixer, andux-flow-validatorupdated to requireflow-runner.shbefore marking any gate green.Test plan
cargo test --locked— 390/390 pass, 7 ignored (real toolchain)cargo clippy --locked --all-targets --all-features— 0 warningscargo fmt --all -- --check— cleancargo build --locked --no-default-features— compilesbash .claude/skills/sunscreen-flow-tests/scripts/flow-runner.sh— 3/3 flows, 52/52 assertions pass/tmp:quickstart nft,scaffold instruction(no--program),learn list🤖 Generated with Claude Code
Summary by CodeRabbit
Bug Fixes
learn listnow shows available topicsdoctor --fixadds a "needs inspection" outcome and clearer repair reportingNew Features
--programneeded)Documentation
doctor --fixdocs with before/after output, logs, and retry/HTTP1.1 download notesTests