Skip to content

docs(agents): the charly rulebook first; gist + skill pointers only - #378

Merged
github-actions[bot] merged 1 commit into
mainfrom
feat/agents-md-restructure
Oct 5, 2026
Merged

github-actions[bot] merged 1 commit into
mainfrom
feat/agents-md-restructure

Conversation

@aitrawog

@aitrawog aitrawog commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Closes #377. Companion PR: opencharly/charly#805, which makes charly/AGENTS.md core-only; both land together. The umbrella AGENTS.md now leads with the whole org-wide charly rulebook, followed by the umbrella rules, and states each rule once as gist plus its owning skill. Head 1aa7bd8; together with the companion charly PR, the two rulebooks go from 307 + 510 to 385 + 84 lines.

  • Part I, "The charly rulebook":
    • R0 with ONE merged, compact Skill Dispatcher: 56 rows, one per trigger, every skill for that trigger in one cell. It covers the union of the old umbrella (26) and charly (~80) tables.
    • Charly CLI discipline, Candyboxing, RDD, ADE, SDD, Prioritize Clean Architecture, Memory hygiene.
    • R1–R10, including R4a and R7a.
    • Disposable-Only Autonomy, Hard Cutover, Agents/Workflows/Teams, the Acceptance checklist, Key Rules.
  • Part II, "Umbrella rules": rules 1–9 keep their numbers, so existing rule N references stay valid.
    • Old rule 10 is folded into Part I and "Post-Execution Policies".
    • Rule 6 absorbs issue-first coordination; rule 8 absorbs validator-verdict discipline.
    • Rule 7 states the governance phrases the reconcile gate requires.
  • Merged once: Post-Execution Policies, AI Attribution with ONE tier table, Command hygiene, Hooks doctrine, Where things are documented. Heading names are kept stable, because they are a public API.
  • Moved to skills (layer-charly-internals#85 and layer-charly-build#20, both merged; projected by chore(refs): bump layer-charly-internals + layer-charly-build; regenerate marketplace#421, merged):
    • the 12-row maintenance table;
    • where the dispatcher comes from;
    • the hooks/DeepWiki specifics;
    • the R4a doctrine;
    • the post-execution steps.
  • reasonix.toml: comment-only fixes of the two pointers to the deleted rule 10. The PR-only landing comment now points at "Post-Execution Policies", and the Destructive working-tree operations comment at R6.

Rule-coverage matrix

Every rule and named clause in today's charly/AGENTS.md lands in exactly one rulebook. Its detail is owned by the skill shown.

Section in today's charly/AGENTS.md Lands in Detail owner
R0. Skills first (mandate + harness loading) umbrella Part I "R0. Skills first" /charly-internals:skills
Skill Dispatcher (~80 rows) umbrella Part I dispatcher, merged and compact (one row per trigger). Core rows also appear in charly "R0 for the core" marketplace/DISPATCHER.md
Candyboxing umbrella Part I /charly-internals:strict-policy
Risk Driven Development (RDD) umbrella Part I /charly-internals:strict-policy
Memory hygiene umbrella Part I /charly-internals:strict-policy
Agent Driven Evaluation (ADE) umbrella Part I /charly-check:check
Schema Driven Design (SDD) org mandate: umbrella Part I. Core pipeline: charly "SDD in the core" /charly-internals:go
Prioritize Clean Architecture Above All Else umbrella Part I /charly-internals:strict-policy
The kernel/plugin boundary law charly (core-only); the umbrella has a one-line pointer /charly-internals:plugin
R1–R8, R10 (incl. R4a, R7a) umbrella Part I "Ground-truth rules R1–R10" strict-policy, root-cause-analyzer, /charly-build:docs (R4a, full doctrine), /charly-check:check (R10)
R9 + the core Go gate paragraph charly "R9 and the core Go gate"; the umbrella R9 bullet points there /charly-internals:go
Disposable-Only Autonomy umbrella Part I /charly-internals:disposable
Hard Cutover by Default (incl. the lineage-check paragraph) umbrella Part I. The worktree-layout paragraphs (×2) become umbrella Part II rule 2 /charly-internals:cutover-policy, /charly-internals:git-workflow
Post-Execution Policies 1–5 umbrella "Post-Execution Policies" (gist) git-workflow references/validator-and-calver (the five steps)
Post-Execution Policies 6 (issue-first) umbrella Part II rule 6 git-workflow (B2b)
Post-Execution Policies 7 (read comments before every push) umbrella Part II rule 8 git-workflow ("BEFORE ANY UPDATE PUSH")
Post-Execution Policies 8 (identity + verb grammar) umbrella Part II rule 7 git-workflow (B2b.1)
Acceptance checklist umbrella Part I, verbatim —
Agents, Workflows & Teams umbrella Part I /charly-internals:agents
Hooks umbrella "Hooks doctrine" /charly-internals:agents
AI Attribution (Fedora Policy Compliant) + tier table umbrella "AI Attribution" + the ONE tier table (merged with the umbrella's table) git-workflow
Key Rules org-wide: umbrella "Key Rules". Kind container, candy:, provenance, strict vs reconcile: charly "Core key rules" —
Command hygiene & context discipline umbrella, one copy (both versions merged) —
Validator verdict discipline umbrella Part II rule 8 ("fix EVERY finding of a BLOCK") git-workflow
Where things are documented umbrella (org-wide) and charly (core), with no overlap —

Umbrella-only content that moved out:

Content Moved to
The 12-row maintenance-command table git-workflow references/umbrella-mechanics and README "Maintenance commands"
Where the dispatcher comes from, and the splice skills "Skill Dispatchers"
check-harness-config.mjs and DeepWiki specifics agents (harness-config section)
Rule 10 folded into Part I (R1/R3–R7/R10) and "Post-Execution Policies"

How tested

On the umbrella worktree, head 1aa7bd8, with a worktree-local charly 2026.278.0913 built by ./charly/scripts/bootstrap-charly.sh:

$ ./charly/bin/charly task verify
task verify: 11 step(s), 0 failed                                   (exit 0)
$ git commit …   # hooks/pre-commit
task policy-b: 1 step(s), 0 failed — [pass] check — policy B holds
task self-test: 1 step(s), 0 failed — [pass] run — self-test sync-pin-evidence + sync-pr-body + sync-dispatcher
check-pr-watch: OK / check-pi-gates: OK / pre-commit: OK
$ node scripts/check-root-refs.mjs && node scripts/check-root-refs.mjs --self-test
check-root-refs: OK … / --self-test: 5 passed, 0 failed
$ node scripts/check-harness-config.mjs && node scripts/check-harness-config.mjs --self-test
check-harness-config: OK / --self-test: OK
$ bash scripts/sync-dispatcher.sh --self-test ; bash scripts/sync-dispatcher.sh --check
self-test OK / marketplace/DISPATCHER.md absent … — no-op     (the table stays outside the generated markers)

Governance reconcile (opencharly/.github origin/main scripts/governance-reconcile.sh --root <tree>, over this AGENTS.md, layer-charly-internals at #85, and the marketplace):

NEW  governance-reconcile: checked=50 skipped=0 fail=0             (exit 0)
OLD  5 FAIL rows on today's main AGENTS.md (window is 60 minutes / takeover, ever /
     RESOLVED — superseded by #<n> / posting ACCOUNT is the entire gate /
     AI_REVIEW_AUTO_CLOSE_AFTER., default 5)                        (exit 1)

So this PR also fixes a drift that already existed: the umbrella was red against the reconcile manifest.

  • Skill references: every /charly-<family>:<skill> reference resolves to an existing marketplace/<family>/skills/<skill>/SKILL.md (script loop, 0 missing).
  • Nothing lost: no reference from either old rulebook is lost (comm -23 → empty).
  • One statement per rulebook: each mandate phrase appears once (grep -c): "MANDATORY — NON-OPTIONAL", "SIGPIPE", the tier-table header, "never pre-load".

Rulebook compliance

  • R0: loaded /charly-internals:git-workflow and /charly-internals:skills before any edit.
  • R1: anomalies were root-caused, not routed around:
    • the reconcile-gate drift (above), fixed by restoring the rule-7 mandates;
    • stale rule pointers in reasonix.toml;
    • the charly/ submodule was absent in the session worktree. The pre-commit hook was not bypassed: charly/ was initialized at its gitlink and the binary built worktree-locally (R9).
  • R2: the full cutover spans the producer skills, marketplace#421, charly#805 and this PR. The one related defect outside this diff's class (the pi parser) is routed to the named issue pi charly_load_skills cannot parse the AGENTS.md dispatcher (reads only inside GENERATED markers; multi-skill cells) #379.
  • R3: every rule is stated once; there are no duplicate copies across the two rulebooks.
  • R4: N/A. No workaround.
  • R4a: N/A. Rulebook prose only.
  • R5: rule 10 is deleted, with its content in Part I. References were swept: rule N pointers 1–9 are unchanged, and the rule-10 pointers are fixed.
  • R6: work happened on a session worktree, with no hook bypass and no force-push.
  • R7: gates were run on the final committed tree, with their output above.
  • R8: N/A. No emitted artifact.
  • R9: worktree-local binary 2026.278.0913.
  • R10: documentation-only class (prose plus TOML comments). The gate is charly task verify plus scripts/check-*.mjs, all passing.

Change classification

  • Change class: documentation-only (AGENTS.md prose, comment-only reasonix.toml).
  • Gate: ./charly/bin/charly task verify plus scripts/check-*.mjs plus governance-reconcile.
  • Attribution tier: documentation reviewed.

Routed, not deferred: .pi/extensions/charly-gates.ts parseDispatcherTable reads only inside the GENERATED markers, which neither today's main nor this AGENTS.md carries (grep -c "BEGIN GENERATED SKILL DISPATCHER" → 0 on both), so pi's charly_load_skills already cannot parse the table. The fix is a code change (the parser plus multi-skill cells plus a check-pi-gates.mjs fixture), filed with evidence and scope as #379.

Agent: agents-md-restructure (Claude Code session)
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (documentation reviewed)

Part I is now the org-wide charly rulebook (formerly only in
charly/AGENTS.md), with one merged, compact Skill Dispatcher (one row per
trigger). Part II keeps the umbrella rules 1–9; rule 10 is folded into
Part I. Duplicated mandates are stated once, and how-to detail (the
maintenance-command table, dispatcher provenance, hooks/DeepWiki specifics,
R4a doctrine, post-execution steps) moves to its owning skill. The rule-7
governance phrases the reconcile gate requires are restored.

Closes #377.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Assisted-by: Claude Code Anthropic Claude Opus 5.5 (documentation reviewed)
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Review — BLOCK

Head SHA: 1aa7bd8b89316563600e48d700fb9a013d3a1e5c (branch: feat/agents-md-restructure)

Change class: documentation-only (AGENTS.md prose + comment-only reasonix.toml); the documentation reviewed tier is legal for this diff, and the Assisted-by: footer is present in the correct form.

Blocks

  1. R2 / anti-cheat (B14(b)) — a surfaced defect is parked with no named batch. The body's closing "Known follow-ups, observed and not changed here" defers the .pi/extensions/charly-gates.ts parseDispatcherTable defect — a consumer of the very dispatcher table this PR rewrites — with "Fixing it is a code change and gets its own PR." That is the forbidden vague deferral: R2 permits only fix-in-tree or routing to a NAMED thematic batch/issue, and "its own PR" names neither. Same applies to the TODO.md 10.1 item unless this PR advances it (it explicitly does not: "That still applies"). Fix the defect in-tree, or name the exact batch/issue number it is routed to.

  2. A1 / ground rule 4 — the body asserts a reasonix.toml change that is not in the diff. The Summary states the reasonix.toml edit is "comment-only fixes of stale rule pointers (rule 2 → Part II rule 1; rule 10 → "Post-Execution Policies" / R6)". The reasonix.toml diff is +2/-2 and contains only the two rule-10 pointer fixes (the PR-only landing comment and the Destructive working-tree operations comment); no "rule 2" pointer is touched anywhere in the file. Either correct the body, or — if such a stale "rule 2" pointer really exists in reasonix.toml — complete the R5 sweep.

  3. A1 — the dispatcher row count does not match the diff. The body claims the new Skill Dispatcher has "55 rows, one per trigger". The new table in AGENTS.md contains 56 trigger rows (from Git/gh workflow … through The agentteams box …). Reconcile the stated count with the shipped table.

Verdict: BLOCK


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Review — PASS

Head SHA: 1aa7bd8b89316563600e48d700fb9a013d3a1e5c (branch: feat/agents-md-restructure)

Security screen: PASS — docs-only diff (AGENTS.md prose + comment-only reasonix.toml, +2/-2 both # lines); no secrets/exfiltration/network/obfuscation; no guardrail weakened (PR-only landing, producer-first, no-force-push/no-direct-push, maintainer-account-only sign-off, R1–R10, disposable-only, hard-cutover all preserved or strengthened); the rulebook edit is opened by maintainer-set account @aitrawog.

Comments: 1 considered — bot BLOCK #6001431292, all three findings re-derived against the current state and each stale-superseded: (1) the body no longer says "gets its own PR" — it now routes the .pi parser defect to the NAMED issue #379 (R2 satisfied); (2) the body no longer claims a "rule 2" pointer fix, and the current reasonix.toml diff contains exactly the two rule-10 pointer fixes the body describes; (3) the body now states 56 rows and the shipped dispatcher table contains exactly 56 trigger rows (recounted).

Checklist: All applicable rules PASS or NA. (Docs-only class: R10 bed NA, R8 NA, R4a NA — prose only, ADE/SDD NA — no candy/schema touched; body's 307 → 385 line claim matches the diff hunks exactly; single atomic commit; tier documentation reviewed legal for this diff.)

Verdict: PASS


ollama-cloud/deepseek-v4.1-flash — action-review.

View action run

@github-actions
github-actions Bot enabled auto-merge (squash) October 5, 2026 19:22
@github-actions
github-actions Bot merged commit 618dfa4 into main Oct 5, 2026
1 of 2 checks passed
charly-auto-merge Bot added a commit that referenced this pull request Oct 5, 2026
@aitrawog
aitrawog deleted the feat/agents-md-restructure branch October 5, 2026 19:44
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.

docs(agents): charly rules first in the umbrella AGENTS.md; charly/AGENTS.md core-only; detail to skills

1 participant