Skip to content

feat(selfhost): pass repo instructions to cli reviewers - #2954

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
oktofeesh1:codex/1471-selfhost-system-append
Jul 4, 2026
Merged

feat(selfhost): pass repo instructions to cli reviewers#2954
JSONbored merged 1 commit into
JSONbored:mainfrom
oktofeesh1:codex/1471-selfhost-system-append

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

  • Adds CLI-specific system-append handling so repository review instructions reach self-host CLI reviewers through the system prompt channel.
  • Removes the duplicate instruction block from stdin prompts for those CLI reviewers while keeping Workers provider request payloads unchanged.
  • Regenerates the self-host environment reference after the source line-number shifts.

Closes #1471

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • None. npm run test:ci passed after rebasing onto current upstream/main; it covers the checked commands above plus the repository's generated-artifact, migration, observability, miner, REES, OpenAPI settings-parity, UI version-audit, and UI test checks.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

No visible UI layout or state change. The UI file change is the generated self-host environment reference table updating source line references.

Notes

  • The change is limited to self-host review prompt handling and the generated environment reference.

Add system-append support for subscription CLI review runners so repository instructions can travel through CLI-specific system prompt channels without duplicating stdin prompt text.

Thread the append field only to self-host CLI reviewer models, keep Workers provider requests unchanged, and regenerate the self-host environment reference.
@JSONbored
JSONbored merged commit 1ea4f76 into JSONbored:main Jul 4, 2026
7 checks passed
@JSONbored JSONbored added gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor labels Jul 4, 2026
@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 96.05%. Comparing base (4f085cd) to head (0798c3f).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2954   +/-   ##
=======================================
  Coverage   96.05%   96.05%           
=======================================
  Files         259      259           
  Lines       28571    28594   +23     
  Branches    10396    10407   +11     
=======================================
+ Hits        27444    27467   +23     
  Misses        490      490           
  Partials      637      637           
Files with missing lines Coverage Δ
src/selfhost/ai.ts 98.18% <100.00%> (+0.05%) ⬆️
src/services/ai-review.ts 95.64% <100.00%> (+0.12%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

JSONbored added a commit that referenced this pull request Jul 11, 2026
…an interactive plan or a prompt injection (#5079) (#5080)

Two compounding bugs in createClaudeCodeAi, confirmed live via two real
ai_review_provider_unparseable_output events where the model explicitly
refused, citing both:

1. --permission-mode plan has been passed to every claude invocation
   since the self-host stack's original commit. This activates the
   full interactive Plan-Mode workflow (explore, draft a plan, wait for
   ExitPlanMode approval), not just a read-only restriction --
   disallowedTools already forbids every mutating/networked tool, so
   nothing needing that framing remains. Switched to bypassPermissions,
   matching the "no TTY to answer a prompt, disallowedTools is the real
   boundary" intent this call already has.

2. systemAppend (repo-level review instructions from .gittensory.yml)
   was textually prepended into the stdin prompt behind a literal
   "ADDITIONAL SYSTEM INSTRUCTIONS:" header. This was implemented
   correctly in #1471/PR #2954 via the real --append-system-prompt
   flag, then regressed by a later commit that moved it back to
   textual stdin-smuggling to keep the content out of argv/`ps aux` --
   inadvertently recreating the textbook shape of a prompt-injection
   attack, which claude-code's own safety training correctly flags as
   suspicious. Now written to a file inside the same per-call isolated
   temp dir already used for the subprocess cwd, passed via
   --append-system-prompt-file: content stays out of argv AND out of
   the untrusted-looking stdin blob.

codex is unaffected (--sandbox read-only, not --permission-mode; no
CLI-native system-prompt-file equivalent, per #1471's own documented
limitation -- keeps its existing textual-prepend approach).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Development

Successfully merging this pull request may close these issues.

feat(selfhost): wire claude --append-system-prompt for review instructions (v2 refinement)

2 participants