Skip to content

docs(internals): codify the per-session worktree/branch lifecycle - #257

Merged
atrawog merged 2 commits into
mainfrom
feat/worktree-session-lifecycle
Aug 13, 2026
Merged

atrawog merged 2 commits into
mainfrom
feat/worktree-session-lifecycle

Conversation

@atrawog

@atrawog atrawog commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

The per-session worktree/branch lifecycle is now codified end-to-end. This commit is the superproject leg of a cross-repo docs cutover: it carries the source-of-truth manifest edits in candy/charly-internals/charly.yml, the equivalent mandates in the harness rulebooks (CLAUDE.md Key Rules + AGENTS.md "Hard Cutover by Default"), the housekeeping .gitignore addition, the CHANGELOG narrative, and the gitlink bumps pointing both submodules at their merged upstream commits.

The rule now codified: every session works in its OWN worktree under .claude/worktrees/<slug>/, branched off fresh origin/main; the main tree stays on main — created at session start, removed (worktree + branch) after the PR lands, so parallel sessions never collide on one checkout.

Edits in this repo:

  • candy/charly-internals/charly.yml — the manifest source of truth for the two skills:
    • git-workflow B1 gains Step 0 (create the session worktree under .claude/worktrees/<slug>/, branched off fresh origin/main; the main tree stays on main), and Step 1's sync-before-start now uses git worktree add … -b feat/<slug> origin/main instead of git switch -c in the shared main tree. B4 "Worktree hygiene" is expanded into the full per-session create → work → land → remove lifecycle with the exact commands and the MERGED-state gate for removal. B7 states the one-worktree-per-session rule and that the main tree stays on main.
    • agents "Worktree lifecycle and validator identity" is clarified: the orchestrator-owned rule governs only the worktrees of the agents a team spawns; a new bullet + the orchestration-model responsibility-matrix "Standalone sessions" paragraph state that independent parallel sessions own their own worktree lifecycle.
  • CLAUDE.md — new Key Rules bullet carrying the equivalent mandate with a /charly-internals:git-workflow (B1 step 0, B4 "Worktree hygiene", B7) detail pointer.
  • AGENTS.md — "Hard Cutover by Default" extended with the same mandate + detail pointer.
  • .gitignore — the untracked .claude/hooks/__pycache__/ Python bytecode is now gitignored.
  • CHANGELOG/2026.999.9999.md — the cutover narrative (placeholder CalVer; the pr-validator finalizes it at merge).
  • plugins + docs gitlinks — bumped to the MERGED upstream commits: plugins@7c9c3415 (PR docs: fix CHANGELOG H1 headings to use CalVer version #155) and docs@a99b5e66 (PR docs(hooks): record the ceded boundary for merge-family index mutators #45 + the follow-up PR chore(box/cachyos): bump gitlink — charly-cachyos is no longer a check bed #46 adding the docs per-repo CHANGELOG entry).

The submodule legs (regenerated from these manifest edits, never hand-edited) landed first, producer→consumer: plugins PR #155 and docs PR #45 (+ follow-up #46), each validated and merged by a fresh pr-validator.

Change class

docs-only (cross-repo: plugins → docs → superproject, producer→consumer).

How R10-tested — exact gate, commands, and pasted output

  • The gate for this change class: the non-runtime standards for the documentation-only change class — no disposable bed applies.
  • Eval beds run: N/A (docs-only — no runtime behavior changed).
  • Fresh rebuild: the worktree-local binary was rebuilt from the current superproject source by task docs:sync / task skills:sync (both run task :build:binary first); bin/charly version reports 2026.225.0157.
  • Did the CHANGED code path execute live? N/A (docs-only). The regeneration pipeline executed: charly docs generate (880 pages) and charly marketplace generate --root produced exactly the 4 changed pages / 4 changed skill files, and re-running each is a byte-for-byte no-op (proven by the two submodule pr-validators independently, and by task docs:drift / task skills:drift stage-1 idempotency on the committed tree).
  • Concurrency: N/A (no shared-state change). The three repo legs landed producer→consumer with independent fresh validators.
# regeneration idempotency — the generators' output matches the committed sources:
task docs:drift     # stage 1 `charly docs generate` regeneration is a no-op
task skills:drift   # stage 1 `charly marketplace drift --root` PASSED
./bin/charly box validate   # exit 0, zero warnings

Attribution tier

documentation reviewed — the entire diff is regenerated documentation + rulebook mandates + a docs-only gitlink bump. No code/config behavior touched.

Harness rulebook compliance — state HOW each is satisfied (or N/A — <reason>)

  • R0 skills: the change's area loads /charly-internals:skills (skill authoring — regenerate from the candy manifest, never hand-edit generated files) and /charly-internals:git-workflow (the B1/B4/B7 text being changed); the source edits were made in the superproject's candy/charly-internals/charly.yml and regenerated into plugins + docs by their generators.
  • R1 RCA + zero warnings: charly box validate exit 0, zero warnings; regeneration is a no-op (idempotent) on the committed sources.
  • R2 no out-of-scope: the stale .claude/hooks/__pycache__/ untracked dir surfaced during this cutover is handled by the .gitignore pattern added here; nothing else surfaced.
  • R3 no duplication: the one-worktree-per-session rule is stated once in the owning skill (B4 "Worktree hygiene") and pointed to, not restated, from the other references and the rulebook mandates.
  • R4 no workaround: N/A — no code changed.
  • R5 hard cutover + grep: the old "Worktree hygiene" block and the git switch -c feat/<slug> authoring flow are fully replaced by the session-worktree flow in the same change; no transitional/dual-mode doc remains. A grep for the removed authoring lines returns only the new prohibition.
  • R6 git safety: the feat branch was created off the exact origin/main pin (detached HEAD == origin/main verified), committed with the intended files, and pushed without force. The gitlink bumps point at the MERGED squash commits (verified via gh pr view <n> --json mergeCommit), per B2 step 3.
  • R7 runtime gate: N/A — docs-only, no runtime behavior.
  • R8 artifact invariants: N/A — no Containerfile/label generation; the generation that DID run (marketplace + docs) is verified idempotent.
  • R9 binary == source + deps: binary rebuilt from current source by task docs:sync; charly version = 2026.225.0157; no new runtime OS deps.
  • R10 disposable + coverage: N/A (docs-only — no bed applies; the docs-only class runs the non-runtime standards above).
  • RDD / ADE / SDD: RDD N/A (no high-risk runtime assumption). ADE N/A (no candy touched). SDD N/A (no schema/.cue edit).
  • Hard cutover: one atomic commit in this repo; the cutover spans three repos landed producer→consumer (plugins → docs → superproject), each its own PR.
  • Kernel/plugin boundary law: N/A — no core/sdk change.
  • Disposable-only autonomy: N/A — no destroy/rebuild performed.
  • Clean architecture + Go gates: N/A — no Go changed.
  • CHANGELOG: this commit carries CHANGELOG/2026.999.9999.md (the cutover narrative; the pr-validator finalizes the CalVer). The submodule legs each carried their OWN per-repo CHANGELOG entry (every plugins + docs landing stages one, per each repo's standing convention): plugins PR docs: fix CHANGELOG H1 headings to use CalVer version #155 and docs PR docs(hooks): record the ceded boundary for merge-family index mutators #45/chore(box/cachyos): bump gitlink — charly-cachyos is no longer a check bed #46. All repos tag at merge under v<YYYY.DDD.HHMM> per the standing rule.

Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)

Every session that commits/branches/pushes now works in its OWN worktree under .claude/worktrees/<slug>/, branched off fresh origin/main; the main tree stays on main (only one worktree can hold it, B7). Codified in the candy/charly-internals manifest (B1 step 0, B4 "Worktree hygiene", B7), the agents references (worktree-lifecycle ownership + "Standalone sessions"), and the rulebooks (CLAUDE.md Key Rules + AGENTS.md "Hard Cutover by Default"). Cross-repo producer->consumer: plugins PR #155 + docs PRs #45/#46 (regenerated from these manifest edits) landed first; this commit carries both gitlink bumps (plugins@7c9c3415, docs@a99b5e66). Also gitignores the untracked .claude/hooks/__pycache__/ Python bytecode.

Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)
@atrawog

atrawog commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — APPROVED ✅

Change class: docs-only (cross-repo: plugins → docs → superproject, producer→consumer)

Head SHA validated: 0e8943f223e53a1217895c0db94be8ec99052e03 (feat/worktree-session-lifecycle)

Checklist

  • [PASS] 0. Security & anti-tampering (T1–T4): no exfiltration, scope-mismatch, weakened-gate, or supply-chain finding. The gitlink bumps point at the MERGED upstream commits (verified below). No embedded directives aimed at the validator.
  • [PASS] 1. Description complete: template filled — Summary accounts for every file; How R10-tested names the docs-only gate (non-runtime standards, no beds) with pasted drift output; rule-compliance section answers every applicable rule with a HOW or N/A; body ends with the *Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)* footer.
  • [PASS] 2. Change-class gate: docs-only → non-runtime standards. Re-ran all three myself: charly box validate exit 0 zero warnings; charly marketplace drift --root clean (396 artifacts match); task docs:drift no-op (880 pages, no drift).
  • [PASS] 3. Attribution tier: documentation reviewed is the correct ceiling for a docs-only diff. Minor evidence staleness: the body's bin/charly version claim (2026.225.0157) predates a rebuild — the binary rebuilt from current source reports 2026.225.1106 (matches commit date 13:06+0200 = 11:06 UTC). Substance verified; not tier-relevant.
  • [PASS] 4. R0 skills: git-workflow (B1/B4/B7 text being changed), skills (regenerate from manifest), strict-policy, validate, docs, reconcile, agents all loaded and spot-checked against the diff.
  • [PASS] 5. R1 RCA + zero warnings: charly box validate exit 0, zero warnings; marketplace drift clean; docs drift no-op. No failures/warnings in evidence.
  • [PASS] 6. R2 no out-of-scope: the surfaced .claude/hooks/__pycache__/ untracked dir is handled by the .gitignore addition in this same commit.
  • [PASS] 7. R3 no duplication: the one-worktree-per-session rule is stated once in the owning skill (B4) and pointed to, not restated, from the rulebook mandates (which carry the rulebook-level statement + detail pointer, per the rulebook structure).
  • [PASS] 8. R4 no workaround: N/A — no code changed.
  • [PASS] 9. R5 hard cutover + grep self-test: re-ran the sweep myself. git switch -c feat/<slug> survives ONLY as the new prohibition text (B1 step 0, B4) and the submodule-pointer-bump caution (B2 step 3) — in the superproject manifest, the plugins submodule, and the docs submodule. No transitional/dual-mode doc remains.
  • [PASS] 10. R6/R8/R9: R6 — feat branch off origin/main, no force-push, working tree clean. R8 — N/A (no Containerfile/label generation; the marketplace + docs generation that ran is verified idempotent). R9 — binary rebuilt from current source (2026.225.1106), no new runtime OS deps.
  • [PASS] 11. R10: N/A for docs-only — the non-runtime standards above are the gate and all pass.
  • [PASS] 12. RDD/ADE/SDD: RDD N/A (no high-risk runtime assumption); ADE N/A (no candy touched); SDD N/A (no schema/.cue edit — the manifest edits regenerate idempotently, proven by the drift checks).
  • [PASS] 13. Concurrency mandate + anti-cheat: N/A — no shared-state change; the three repo legs landed producer→consumer with independent fresh validators.
  • [PASS] 14. Hard cutover: one atomic commit in this repo; cross-repo cutover landed producer→consumer (plugins docs: fix CHANGELOG H1 headings to use CalVer version #155 → docs docs(hooks): record the ceded boundary for merge-family index mutators #45/chore(box/cachyos): bump gitlink — charly-cachyos is no longer a check bed #46 → this superproject commit).
  • [PASS] 15. Architecture gate: N/A — no core/sdk change; the manifest edits are to the candy source of truth.
  • [PASS] 16. Disposable-only autonomy: N/A — no destroy/rebuild performed.
  • [PASS] 17. Clean architecture + Go gates: N/A — no Go changed.
  • [PASS] 18. CHANGELOG present: CHANGELOG/2026.999.9999.md — filename matches ^\d{4}\.\d{3}\.\d{4}\.md$, H1 byte-equals # 2026.999.9999 — codify the per-session worktree/branch lifecycle, placeholder does not exist as a tag or CHANGELOG file on main.

Phase 1b — documentation scrutiny

  • Cold reader spawned (general-purpose, forbidden every other source). Findings: the new mandate text passes the sixty-second test ("the rule, in one sentence: every session must do its work in its own private git worktree under .claude/worktrees/<slug>/..."). The comprehension gaps it reported (operator, protected, submodule lineage, approved boundary) are all in PRE-EXISTING AGENTS.md text this PR did not touch; the new text's only undefined terms (session, slug) are standard rulebook vocabulary with the detail pointer /charly-internals:git-workflow (B1 step 0, B4, B7) supplying the full procedure. Verified-non-blocking.
  • Contradiction sweep: the mandate is consistent across CLAUDE.md, AGENTS.md, and the skill (B1 step 0 / B4 / B7). No negative/positive collision.
  • R4a: no commands in the new text; the detail pointer is a skill reference, not a reader command.
  • Abbreviation expansion: PR used in context; no unexplained abbreviations introduced.

Gitlink verification (re-derived, not taken from the body)

  • git ls-tree HEAD docs plugins → docs@a99b5e66d372c39f15b626d9786fc4afbc072b08, plugins@7c9c34150f87876823aef8554f9f709a2244150d
  • gh pr view 155 --repo opencharly/plugins --json mergeCommit → 7c9c34150f87876823aef8554f9f709a2244150d ✓ (tag v2026.225.1102 on that commit, verified via git ls-remote)
  • gh pr view 46 --repo opencharly/docs --json mergeCommit → a99b5e66d372c39f15b626d9786fc4afbc072b08 ✓ (tag v2026.225.1058 on that commit, verified)
  • docs PR docs(hooks): record the ceded boundary for merge-family index mutators #45 merge a252df9aea26108e97e6529625ae17674f4e31a3 (tag v2026.225.1028, verified)
  • Submodule checkouts at the merged commits, clean, unmutated.

Comments considered

None — the PR carried no comments.

Cross-PR interactions considered

None open in opencharly/charly, opencharly/plugins, or opencharly/docs.

Decision

PASS. The PR is a documentation-only change class validated against the non-runtime standards, all of which I re-ran myself and confirmed green at zero warnings. The manifest edits regenerate idempotently (marketplace drift + docs drift both no-op), the gitlinks point at the verified merged producer commits, and the R5 sweep confirms the old authoring flow survives only as prohibition/caution text. Proceeding to finalize the merge-time CalVer, squash-merge, and tag.

Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)

Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)
@atrawog
atrawog merged commit d2221f4 into main Aug 13, 2026
@atrawog
atrawog deleted the feat/worktree-session-lifecycle branch August 13, 2026 11:15
@atrawog

atrawog commented Aug 13, 2026

Copy link
Copy Markdown
Contributor Author

pr-validator — merge outcome

  • Status posted: charly/pr-validator = success on 0e8943f2 (initial head) and re-posted on 427a12cc (post-CalVer head). ALLOWED (no denial).
  • CalVer finalized: CHANGELOG/2026.999.9999.md → CHANGELOG/2026.225.1114.md, H1 rewritten to # 2026.225.1114 — codify the per-session worktree/branch lifecycle (byte-verified before commit).
  • Squash merge: ALLOWED. Merged as d2221f4f5bcbc094f25e15ea5bd38ede4fef571f (squash, --delete-branch). Pre-merge trailer parse and post-merge object parse both equal Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed).
  • Tag: v2026.225.1114 created on the merged HEAD and pushed; peeled ref v2026.225.1114^{} = d2221f4f5bcbc094f25e15ea5bd38ede4fef571f (verified via git ls-remote).
  • Post-landing state: main tree on main at d2221f4f, working tree clean, submodules at the pinned gitlinks (plugins@7c9c3415, docs@a99b5e66), local feat branch deleted.

Assisted-by: Claude Code deepseek-v4-flash:cloud (documentation reviewed)

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