Skip to content

feat(pi): replace the injected rules copy with an operating-principles complement - #43

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/pi-system-prompt
Aug 29, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/pi-system-prompt

Conversation

@atrawog

@atrawog atrawog commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Summary

Replaces the pi system prompt's injected rules block in .pi/extensions/umbrella-gates.ts from a hand-written condensed copy of AGENTS.md into an operating-principles + tool-usage complement.

Why: the old block was an R3 violation (policy duplicated in prose outside its owner), had drifted (added "Validator Verdict Discipline" not in AGENTS.md; missed the 8-rule Rulebook and Command hygiene), and duplicated what pi already auto-loads (the full AGENTS.md is in project_context).

The new block references AGENTS.md by name/section/skill instead of re-stating rules — it cannot drift because it holds no rule text:

  • AGENTS.md is the authoritative rulebook — always follow it; prioritize clean architecture, fully tested, deduplicated code
  • All decisions come from AGENTS.md — ambiguous choices resolve from it or surface as blockers
  • Goal-driven autonomous completion — create_goal at task start, loop until the goal is met
  • Completion is defined, not felt — only when all todos/tasks are done and verified, or a blocker not fixable solely from AGENTS.md
  • RCA every anomaly (R1) — enforced, no exceptions
  • Spike on a check bed — never guess — settle uncertainty on a disposable charly check bed, verify live
  • Tool usage section — todo, create_goal, subagent, gh_pr_status, umbrella_load_skills, memory_*, web_search/fabric_exec/mcp.*, charly check beds

How tested

All tests run via pi -p (non-interactive CLI) from the committed tree.

System prompt audit (live session reporting its own prompt):

1. YES — '## Operating principles' with all 10 headings (AGENTS.md authoritative,
   decisions from AGENTS.md, goal-driven, completion defined, skills first,
   RCA enforced, spike on check bed, prove the gate, validator verdicts, command hygiene)
2. YES — '## Tool usage' with all 8 lead-ins (todo, create_goal, subagent,
   gh_pr_status, umbrella_load_skills, memory_*, web_search/fabric_exec/mcp, charly check beds)
3. "Always follow the rules in AGENTS.md when writing or modifying new code, and
   always prioritize a clean architecture and fully tested and deduplicated code over anything else."
4. NO — '## Umbrella Engineering Rules' section gone (no drift)
5. NO — no duplicated rule text (R6/rulebook text not re-stated)
6. create_goal: YES; gh_pr_status: YES; todo: YES; subagent: YES

Functional tool tests (all four advertised tools executed live):

TEST1 — create_goal OK: goal created, status active
TEST2 — umbrella_load_skills OK: charly-internals:git-workflow content returned
TEST3 — gh_pr_status OK: opencharly/opencharly#42 state MERGED, verdict PASS
TEST4 — todo OK: task created (pending)

Static content check (node strip-types): all 19 assertions pass — every section present, verbatim principle present, old drift section absent, no rule-text duplication.

Pre-commit gate:

check-policy-b: OK — 5 distro pins equal charly's gitlinks
check-harness-parity: OK — 5 shared harness files identical to charly/
pre-commit: OK

Rulebook compliance

Rule Status
R3 (no duplication) Injected block holds no rule text — references AGENTS.md by name/section/skill; cannot drift
R6 (git safety) feat/ branch, push only, no force-push
R7 (gate proven) Live pi -p audit + functional tests + pre-commit gate pasted above
R10 (fresh tree) All tests run from the committed tree
Rule 8 (harness parity) .pi/extensions/umbrella-gates.ts is a fork (not in parity SHARED list); check-harness-parity OK

Change classification

  • Change class: harness config (pi extension system-prompt injection)
  • Verification gate: live pi -p system-prompt audit + functional tool tests + pre-commit gate
  • Attribution tier: fully tested and validated

Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)

…s complement

The system prompt's injected block was a hand-written condensed COPY of
AGENTS.md (R3 violation: policy duplicated outside its owner) that had
drifted (added 'Validator Verdict Discipline' not in AGENTS.md; missed the
8-rule Rulebook and Command hygiene) and duplicated what pi already
auto-loads (full AGENTS.md in project_context).

Replaced with a complement block that references AGENTS.md by name/section/
skill instead of re-stating rules — it cannot drift because it holds no rule
text:

- AGENTS.md is the authoritative rulebook; always prioritize clean
  architecture, fully tested, deduplicated code.
- All decisions come from AGENTS.md; ambiguous choices resolve from it or
  surface as blockers.
- Goal-driven autonomous completion: create_goal at task start, loop until
  the goal is met.
- Completion is defined: only when all todos/tasks are done and verified,
  or a blocker that cannot be fixed solely from AGENTS.md.
- RCA every anomaly (R1) — enforced, no exceptions.
- Spike on a check bed — never guess: settle uncertainty on a disposable
  charly check bed, verify live.
- Tool usage section: todo, create_goal, subagent, gh_pr_status,
  umbrella_load_skills, memory_*, web_search/fabric_exec/mcp, charly check
  beds.

Verified live via pi -p: the injected block contains all sections and the
verbatim principle, no 'Umbrella Engineering Rules' drift section, no
duplicated rule text; create_goal, umbrella_load_skills, gh_pr_status, and
todo all execute successfully.

Assisted-by: pi openrouter/deepseek/deepseek-v4-flash-0731 (fully tested and validated)
@github-actions

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 5ab1f8166a31 (branch: feat/pi-umbrella-gates-complement)

Security screen: PASS — no secrets, exfiltration, network calls, or new dependencies; the change is a text-block replacement in a pi extension. The new block references AGENTS.md as the authoritative rulebook and preserves the guardrails (R0/R1/R7, validator-verdict discipline, command hygiene) by name/section rather than re-stating them — a genuine R3 de-duplication, not a weakening.

Checklist: All applicable rules PASS or NA.

  • A1/A2/A3: Body complete (Summary, How tested, Rulebook compliance, Change classification, exact *Assisted-by:* footer). Change class = harness config; gate = live pi -p audit + functional tool tests + pre-commit gate, all pasted. Tier fully tested and validated justified: the changed path (injected block) executed live and was audited.
  • B5/B6/B7/B10: No warnings; self-contained (no R2 split); removes duplication (R3); old ## Umbrella Engineering Rules block fully removed in the same atomic commit (R5).
  • B12/B14: Evidence internally consistent with the diff — the audit's 10 operating-principles headings and 8 tool-usage lead-ins match the diff exactly; the quoted verbatim principle matches; the "old section gone / no duplication" claims are backed by pasted audit output. No forbidden framing.
  • B16/B17/B18: NA (pi-extension config, not core/sdk/candy; no Go changes; no destroy/rebuild).

Verdict: PASS


ollama/deepseek-v4-flash — pi-review-action.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) August 29, 2026 19:18
@github-actions
github-actions Bot merged commit 3c30f25 into main Aug 29, 2026
1 check passed
charly-auto-merge Bot added a commit that referenced this pull request Aug 29, 2026
github-actions Bot pushed a commit that referenced this pull request Sep 4, 2026
atrawog added a commit that referenced this pull request Sep 8, 2026
… re-capture fix, #44 eval-pr driver, #45 redo-wave reports + their CHANGELOG commits)
github-actions Bot pushed a commit that referenced this pull request Sep 8, 2026
…l-pr driver + redo-wave reports) (#168)

* sync(eval-omarchy): gitlink 41174c45 -> 95b778e (the re-capture fix #43, the eval-pr driver #44, the redo-wave reports #45)

* sync(eval-omarchy): gitlink -> a8e8fa1 (the real current main HEAD: #43 re-capture fix, #44 eval-pr driver, #45 redo-wave reports + their CHANGELOG commits)
@aitrawog
aitrawog deleted the feat/pi-system-prompt branch September 25, 2026 18:27
github-actions Bot pushed a commit that referenced this pull request Oct 26, 2026
#703)

The arm landed in #699 read THREE of the NINE closing keywords GitHub
accepts — `Closes`, `Fixes`, `Resolves`, capitalised — and its fence
reader could not tell a four-backtick fence from a three-backtick one.
Both were raised by the fresh `charly/pr-validator` on #699 itself, so
the arm's claim — "every closing directive names something the
directive CAN close" — was false for six of the nine forms and for
every case GitHub accepts.

GitHub's "Linking a pull request to an issue" names the whole set
(`close`, `closes`, `closed`, `fix`, `fixes`, `fixed`, `resolve`,
`resolves`, `resolved`) and adds: "The keywords can be followed by
colons or in uppercase." The arm read none of those forms. This
repo's own 447 merged bodies carry 52 line-starting bare `#N`
directives, and the three forms the arm read were exactly the three it
read.

The fence reader was TWO readers of one thing: `proseLines` toggled on
a backtick or a tilde fence, `fencedBlocks` toggled on a backtick fence
only, and both ignored CommonMark's fence rules. So a body could paste
evidence in a tilde block and the evidence arm never saw it; a
four-backtick fence closed early at the three-backtick line inside it;
a directive after a nested fence escaped the arm entirely; and a run
followed by text closed a fence that CommonMark says is still open.

ONE scanner now serves both readers, and it implements CommonMark's
fence rules: the length rule, and the closing fence's rule that only
whitespace may follow the run (an info string belongs to the OPENING
fence alone). The keyword grammar reads all nine forms,
case-insensitively, with the optional colon, and the finding quotes the
directive as it was written. The boundary the widening does NOT cross
is the arm's POSITION — a directive is read only when the body OPENS a
line with it — and that boundary is measured and filed rather than
asserted: 8 mid-line directives in this repo's 447 merged bodies, 3 of
them naming a pull request and 2 of them legitimate prose ("the
auto-closed #348", "the channel bootstrap fix #43's gitlink") that a
full-parity grammar would block.

The self-test's fixture table was spelled out in twelve arms and is
now one constant, so no arm can spell the table differently from
another.

R7: the self-test grows to 30 live arms — one per keyword form, the
uppercase form, the colon form, a directive after a nested fence, a
tilde-fenced evidence block, a directive inside a nested fence, a
mid-line directive, and a fence whose closing line carries text. On
four bodies the OLD gate is green and the NEW gate is red, and on two
the OLD gate is red and the NEW gate is green; the ONE difference
between the two runs is this change.

Closes #702
Refs #700
Refs #701

Assisted-by: Claude Code minimax/minimax-m3.1-flash:cloud (fully tested and validated)
github-actions Bot pushed a commit that referenced this pull request Nov 14, 2026
* chore(pins)!: advance the unit-8 pins and re-anchor the census

The umbrella pin wave for opencharly/spec#304 unit 8 (#1024).

Eight pins move: charly (the fleet), the three distros (their own waves), plugin-check
(#149), plugin-substrate (#42/#43/#44/#45/#46/#47), sdk (#514) and spec (#320/#321).

The census follows the body: three dulling rows re-anchor to the plugin module, with the
three KEEPER citations (#VmBackend, #VmBackendName, #VmKrun) correctly staying in spec -
a blanket rewrite moved them and the control caught it. The D-PAT census lowers the twin
row and records the plugin union: the six D-PAT-2 dup findings the deletion created are
gone because plugin-substrate#47 removed the duplicate defs.

TODO.md row 2.1 reads Units 1-8 of 11 with the unit nine legs, its counts (KindValueDefs
3 -> 2, five bodies remain) and its three lessons; the ledger carries the P01 row (3 units
left) and the §9 record.

Measured on the served tree: the assembled graph builds clean, the corpus sweep moved zero
verdict classes, currency 8 of 409 -> 3 of 409, the design controls and the 48-step pin
gate green.

Assisted-by: DeepSeek Harness ollama-cloud/deepseek-v4.1-flash (fully tested and validated)

* docs: the four gitlinks and where the other four went (review round)

* docs(ledger): the P01 state column names unit 8 (review round)

* docs: the rollback sentence says four (review round)

---------

Co-authored-by: aitrawog <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant