create-egregore 0.20.0 → 0.20.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/egregore-launcher.js +80 -15
- package/lib/local.js +4 -20
- package/lib/setup.js +21 -4
- package/package.json +2 -2
- package/runtime/codex/.codex/config.toml +3 -0
- package/runtime/codex/.codex/skills/archive/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/branch/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/checkup/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/commit/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/contribute/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/delete-user/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/ingest/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/ingest-corpus/SKILL.md +29 -0
- package/runtime/codex/.codex/skills/ingest-notion/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/ingest-user-interview/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/issue/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/me/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/meeting/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/note/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/notion-connect/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/onboarding/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/pr/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/push/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/reflect/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/review-pr/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/save/SKILL.md +3 -1
- package/runtime/codex/.codex/skills/slack-connect/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/summon/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/sync-repos/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/teams-connect/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/telegram-connect/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/telemetry/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/test/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/tutorial/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/update/SKILL.md +1 -1
- package/runtime/codex/.codex/spec-manifest.json +4 -4
- package/runtime/codex/AGENTS.md +52 -39
- package/runtime/codex/bin/agent.sh +32 -8
- package/runtime/codex/bin/codex-render-spec.mjs +31 -34
- package/runtime/codex/bin/codex-sync-skills.sh +6 -1
- package/runtime/codex/bin/contribute-guard.sh +79 -0
- package/runtime/codex/bin/handoff-pr-backfill.sh +1 -1
- package/runtime/codex/bin/handoff-run.sh +8 -3
- package/runtime/codex/bin/handoff-save-egregore.sh +20 -8
- package/runtime/codex/bin/ingest.py +260 -5
- package/runtime/codex/bin/lib/git-message.sh +37 -0
- package/runtime/codex/bin/lib/git-sync.sh +26 -2
- package/runtime/codex/bin/lib/greeting.sh +2 -2
- package/runtime/codex/bin/search.sh +46 -4
- package/runtime/codex/bin/session-autosave.sh +13 -2
- package/runtime/codex/bin/settings.sh +63 -4
- package/runtime/codex/bin/worktree-create.sh +4 -1
- package/runtime/codex/manifest.json +5 -1
- package/runtime/pi/.codex/config.toml +3 -0
- package/runtime/pi/.codex/skills/archive/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/branch/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/checkup/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/commit/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/contribute/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/delete-user/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/ingest/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/ingest-corpus/SKILL.md +29 -0
- package/runtime/pi/.codex/skills/ingest-notion/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/ingest-user-interview/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/issue/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/me/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/meeting/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/note/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/notion-connect/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/onboarding/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/pr/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/push/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/reflect/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/review-pr/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/save/SKILL.md +3 -1
- package/runtime/pi/.codex/skills/slack-connect/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/summon/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/sync-repos/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/teams-connect/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/telegram-connect/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/telemetry/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/test/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/tutorial/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/update/SKILL.md +1 -1
- package/runtime/pi/.codex/spec-manifest.json +4 -4
- package/runtime/pi/.pi/APPEND_SYSTEM.md +76 -39
- package/runtime/pi/.pi/spec-manifest.json +2 -2
- package/runtime/pi/AGENTS.md +52 -39
- package/runtime/pi/bin/agent.sh +32 -8
- package/runtime/pi/bin/codex-render-spec.mjs +31 -34
- package/runtime/pi/bin/codex-sync-skills.sh +6 -1
- package/runtime/pi/bin/contribute-guard.sh +79 -0
- package/runtime/pi/bin/handoff-pr-backfill.sh +1 -1
- package/runtime/pi/bin/handoff-run.sh +8 -3
- package/runtime/pi/bin/handoff-save-egregore.sh +20 -8
- package/runtime/pi/bin/ingest.py +260 -5
- package/runtime/pi/bin/lib/git-message.sh +37 -0
- package/runtime/pi/bin/lib/git-sync.sh +26 -2
- package/runtime/pi/bin/lib/greeting.sh +2 -2
- package/runtime/pi/bin/pi-render-spec.mjs +52 -26
- package/runtime/pi/bin/search.sh +46 -4
- package/runtime/pi/bin/session-autosave.sh +13 -2
- package/runtime/pi/bin/settings.sh +63 -4
- package/runtime/pi/bin/worktree-create.sh +4 -1
- package/runtime/pi/manifest.json +5 -1
- package/runtime/prime/.codex/config.toml +3 -0
- package/runtime/prime/.codex/skills/archive/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/branch/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/checkup/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/commit/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/contribute/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/delete-user/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/ingest/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/ingest-corpus/SKILL.md +29 -0
- package/runtime/prime/.codex/skills/ingest-notion/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/ingest-user-interview/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/issue/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/me/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/meeting/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/note/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/notion-connect/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/onboarding/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/pr/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/push/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/reflect/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/review-pr/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/save/SKILL.md +3 -1
- package/runtime/prime/.codex/skills/slack-connect/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/summon/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/sync-repos/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/teams-connect/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/telegram-connect/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/telemetry/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/test/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/tutorial/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/update/SKILL.md +1 -1
- package/runtime/prime/.codex/spec-manifest.json +4 -4
- package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +77 -40
- package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
- package/runtime/prime/AGENTS.md +52 -39
- package/runtime/prime/bin/agent.sh +32 -8
- package/runtime/prime/bin/codex-render-spec.mjs +31 -34
- package/runtime/prime/bin/codex-sync-skills.sh +6 -1
- package/runtime/prime/bin/contribute-guard.sh +79 -0
- package/runtime/prime/bin/handoff-pr-backfill.sh +1 -1
- package/runtime/prime/bin/handoff-run.sh +8 -3
- package/runtime/prime/bin/handoff-save-egregore.sh +20 -8
- package/runtime/prime/bin/ingest.py +260 -5
- package/runtime/prime/bin/lib/git-message.sh +37 -0
- package/runtime/prime/bin/lib/git-sync.sh +26 -2
- package/runtime/prime/bin/lib/greeting.sh +2 -2
- package/runtime/prime/bin/prime-render-spec.mjs +52 -28
- package/runtime/prime/bin/search.sh +46 -4
- package/runtime/prime/bin/session-autosave.sh +13 -2
- package/runtime/prime/bin/settings.sh +63 -4
- package/runtime/prime/bin/worktree-create.sh +4 -1
- package/runtime/prime/manifest.json +5 -1
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
{
|
|
12
12
|
"section": "Identity & Upstream",
|
|
13
13
|
"action": "keep",
|
|
14
|
-
"sourceHash": "
|
|
14
|
+
"sourceHash": "86a2c62ce498",
|
|
15
15
|
"note": "Kept; /update, /contribute, /save tokens rendered as $skill tokens."
|
|
16
16
|
},
|
|
17
17
|
{
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
{
|
|
36
36
|
"section": "After Greeting — BRANCH ON FIRST RESPONSE",
|
|
37
37
|
"action": "replace",
|
|
38
|
-
"sourceHash": "
|
|
39
|
-
"note": "EnterWorktree -> bin/agent.sh branch with git checkout fallback; AskUserQuestion -> numbered options in plain text; branch-guard mapped to .codex/hooks/branch-guard.js with instruction fallback; plan-mode note dropped (no plan mode on Codex); /branch + /onboarding -> skill tokens. Handoff claiming and repoState auto-checkout kept verbatim (pure git)."
|
|
38
|
+
"sourceHash": "3bac01c0a00a",
|
|
39
|
+
"note": "EnterWorktree -> bin/agent.sh branch with git checkout fallback; AskUserQuestion -> numbered options in plain text; branch-guard mapped to .codex/hooks/branch-guard.js with instruction fallback; plan-mode note dropped (no plan mode on Codex); /branch + /onboarding -> skill tokens. Handoff claiming and repoState auto-checkout bash kept verbatim (pure git); surrounding prose compressed 2026-08 for the 32 KiB budget, every rule retained."
|
|
40
40
|
},
|
|
41
41
|
{
|
|
42
42
|
"section": "Config Files",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
{
|
|
90
90
|
"section": "Git Workflow",
|
|
91
91
|
"action": "keep",
|
|
92
|
-
"sourceHash": "
|
|
92
|
+
"sourceHash": "40735c0c09ff",
|
|
93
93
|
"note": "Kept; slash tokens rendered as $skill tokens. Branch diagram unchanged (code fence)."
|
|
94
94
|
},
|
|
95
95
|
{
|
|
@@ -12,11 +12,20 @@ This appendix is generated from the reviewed shell-runtime translation of `CLAUD
|
|
|
12
12
|
|
|
13
13
|
## Identity & Upstream
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
Framework direction comes only from `egregore.json.upstream_url`:
|
|
16
|
+
|
|
17
|
+
- **Source** — literal `"none"`: framework changes are authored here.
|
|
18
|
+
`/update` and `/contribute` stop; use `/save`. Public OSS is downstream and
|
|
19
|
+
receives changes only through this repository's release flow.
|
|
20
|
+
- **Downstream** — a repository URL, or an absent key defaulting to
|
|
21
|
+
`egregore-labs/egregore`: framework paths are synced and not authored here.
|
|
22
|
+
|
|
23
|
+
Never infer direction from a repository name or Git remote.
|
|
16
24
|
|
|
17
25
|
**Where changes belong:**
|
|
18
|
-
- **
|
|
19
|
-
- **
|
|
26
|
+
- **Downstream framework is stale:** run `/update`.
|
|
27
|
+
- **Downstream framework needs a fix:** use `/contribute` or file an upstream issue; local patches are overwritten by `/update`.
|
|
28
|
+
- **Source framework needs a fix:** use `/save` into its configured integration and release flow; never `/contribute`.
|
|
20
29
|
- **Org-level work** (memory, org-specific knowledge, managed repos, `egregore.json`): `/save` to this repo.
|
|
21
30
|
|
|
22
31
|
When a user reports broken or missing framework behavior, the first question is "when did you last `/update`?"
|
|
@@ -51,37 +60,34 @@ The project-local Pi extension renders the Egregore startup card (identity, hand
|
|
|
51
60
|
|
|
52
61
|
**Mandatory behavioral rule.** When the user describes work, your **first action** — before reading files, exploring code, or anything else — is to get onto a working branch:
|
|
53
62
|
|
|
54
|
-
The integration branch is `develop`
|
|
55
|
-
`egregore.json.base_branch` is set, that configured branch replaces
|
|
56
|
-
`develop` as the branch point, rebase target, PR base, and protected
|
|
57
|
-
integration branch.
|
|
63
|
+
The integration branch is `develop` unless top-level `egregore.json.base_branch` sets another; the configured branch is then the branch point, rebase target, PR base, and protected branch everywhere below.
|
|
58
64
|
|
|
59
65
|
1. Derive a topic slug from what the user said (kebab-case, 2–4 words)
|
|
60
66
|
2. Run `bin/agent.sh branch --topic "<topic>"` — it resolves the configured base and creates a work branch from `origin/{base}` in a task worktree (`dev/{author}/{slug}`, or `feature/{slug}` / `bugfix/{slug}` when the topic reads as a feature or fix). Continue all file work from the printed path.
|
|
61
|
-
3. Give a value-first workspace receipt
|
|
62
|
-
|
|
63
|
-
`Your stable project is protected. I’m working in a separate workspace for **{topic}**, where changes stay isolated, reviewable, and reversible.`
|
|
64
|
-
|
|
65
|
-
Then expose the implementation as secondary detail:
|
|
66
|
-
|
|
67
|
-
`Workspace: {branch} (worktree).`
|
|
67
|
+
3. Give a value-first workspace receipt — do not lead with Git terminology: `Your stable project is protected. I’m working in a separate workspace for **{topic}**, where changes stay isolated, reviewable, and reversible.` Then, as secondary detail: `Workspace: {branch} (worktree).`
|
|
68
68
|
|
|
69
69
|
**Fallback:** If `bin/agent.sh branch` fails, resolve `{base}` with
|
|
70
70
|
`_get_base_branch`, then use
|
|
71
|
-
`git checkout -b dev/{author}/{slug} origin/{base}`.
|
|
71
|
+
`git checkout --no-track -b dev/{author}/{slug} origin/{base}`.
|
|
72
72
|
|
|
73
73
|
4. Update graph (fire-and-forget): `bash bin/graph-op.sh set-topic "$(cat .egregore-session-id 2>/dev/null)" "topic from slug" "dev/author/slug" 2>/dev/null &`
|
|
74
74
|
|
|
75
75
|
### Starting-work UX contract
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
Sequence: **intent → safe workspace → relevant context → consequential assumptions → execution**. Make Egregore's structure legible without turning task starts into a tutorial; keep technical identifiers secondary to user value.
|
|
78
|
+
|
|
79
|
+
- **Workspace** — the value-first receipt above, only for a new workspace or topic pivot; do not repeat it on the same branch.
|
|
80
|
+
- **Context** — when organizational retrieval materially informs the work, keep the required Egregore Retrieval Beat plus one compact receipt: `↳ Context restored: {decision, handoff, or prior work} · {source/date}`. Never claim context was restored when retrieval found nothing useful.
|
|
81
|
+
- **Assumptions** — surface only consequential ones: `Assumption: {assumption} — based on {evidence}.` Add a correction path when cheap; do not narrate obvious operational choices.
|
|
82
|
+
- **Transition** — state the outcome you are starting toward in one short sentence and begin.
|
|
78
83
|
|
|
79
|
-
|
|
80
|
-
- **Context** — when organizational retrieval materially informs the work, keep the required Egregore Retrieval Beat and then add one compact result receipt: `↳ Context restored: {decision, handoff, or prior work} · {source/date}`. Never claim context was restored when retrieval found nothing useful.
|
|
81
|
-
- **Assumptions** — surface only consequential assumptions that could change the implementation. Use `Assumption: {assumption} — based on {evidence}.` Add a correction path when cheap; do not narrate obvious operational choices.
|
|
82
|
-
- **Transition** — once workspace, context, and assumptions are settled, state the outcome you are starting toward in one short sentence and begin.
|
|
84
|
+
### Returning-work UX contract
|
|
83
85
|
|
|
84
|
-
|
|
86
|
+
When the user continues the current branch's work or asks to resume — sequence: **continuation intent → prior workspace → restored context → open threads → resumed execution**:
|
|
87
|
+
|
|
88
|
+
- Do not create a new workspace for the same topic. After confirming relevance, say: `I found your previous work on **{topic}** and restored its workspace and context.` Show `Workspace: {branch} (worktree).` secondarily.
|
|
89
|
+
- Retrieve relevant decisions, handoffs, or prior work; keep the Retrieval Beat and `↳ Context restored:` receipt. Never claim context was restored from a branch name alone.
|
|
90
|
+
- Name only unresolved items that could change the next move, state the next outcome briefly, and continue without replaying setup.
|
|
85
91
|
|
|
86
92
|
### Handoff claiming
|
|
87
93
|
|
|
@@ -90,7 +96,7 @@ If `addressed_to_user` handoffs exist and the user is picking one up, create the
|
|
|
90
96
|
bash bin/graph-op.sh claim-handoff "$SESSION_ID" "$HANDOFF_SESSION_ID" 2>/dev/null &
|
|
91
97
|
```
|
|
92
98
|
|
|
93
|
-
**Auto-checkout repos from handoff**:
|
|
99
|
+
**Auto-checkout repos from handoff**: after claiming, if `addressed_rich` carries a non-empty `repoState`, check out each entry's branch in its managed repo:
|
|
94
100
|
|
|
95
101
|
```bash
|
|
96
102
|
PARENT_DIR="$(cd .. && pwd)"
|
|
@@ -103,21 +109,19 @@ if [ -d "$REPO_DIR/.git" ] || [ -f "$REPO_DIR/.git" ]; then
|
|
|
103
109
|
fi
|
|
104
110
|
```
|
|
105
111
|
|
|
106
|
-
Report
|
|
112
|
+
Report `✓ Checked out {branch} in {repo1}, {repo2}`; for a merged-away branch, `◐ {repo}: PR #{N} merged — on {base}`. If `repoState` is absent or empty, skip silently.
|
|
107
113
|
|
|
108
|
-
**Exceptions** — skip branching when
|
|
109
|
-
- The user explicitly created or named a branch themselves
|
|
110
|
-
- Already on a working branch AND the user's intent continues the current branch's topic
|
|
114
|
+
**Exceptions** — skip branching when the user explicitly created or named a branch themselves, or the intent continues the current working branch's topic.
|
|
111
115
|
|
|
112
|
-
**Topic pivot
|
|
116
|
+
**Topic pivot:** work **unrelated** to the current branch's topic gets a new branch (`bin/agent.sh branch --topic "<new topic>"`). Do NOT mix unrelated work on one branch.
|
|
113
117
|
|
|
114
118
|
If still on the configured base branch after two messages, create a branch immediately from whatever context you have.
|
|
115
119
|
|
|
116
120
|
### Branch-guard protocol
|
|
117
121
|
|
|
118
|
-
The `.pi/extensions/egregore.ts` `tool_call` gate (loaded after Pi project trust) protects project writes on the configured base
|
|
122
|
+
The `.pi/extensions/egregore.ts` `tool_call` gate (loaded after Pi project trust) protects project writes on the configured base plus `develop`/`main`/`master`. Its block message is operational guidance — do not interrupt the user with routine Git choices:
|
|
119
123
|
|
|
120
|
-
- **Topic is clear**
|
|
124
|
+
- **Topic is clear** → run `bin/agent.sh branch --topic "<topic>"` automatically, continue in the printed worktree, and say one short sentence so the change is visible — never ask approval for routine branching.
|
|
121
125
|
- **Topic is genuinely ambiguous** → ask only for the topic, using compact numbered options:
|
|
122
126
|
|
|
123
127
|
```text
|
|
@@ -130,9 +134,11 @@ The `.pi/extensions/egregore.ts` `tool_call` gate (loaded after Pi project trust
|
|
|
130
134
|
Wait for the reply, then branch.
|
|
131
135
|
- **The user explicitly requested the protected branch** → that request is consent. Record it with `echo '{branch}' > .egregore-branch-consent`, then retry. Never create the marker merely to silence the hook.
|
|
132
136
|
|
|
133
|
-
|
|
137
|
+
If Pi project resources are disabled, keep the same rule.
|
|
134
138
|
|
|
135
|
-
|
|
139
|
+
**History:** Do not merge, cherry-pick, or rebase another task merely to read
|
|
140
|
+
it; use `gh pr view/diff`, `git show`, or a temporary worktree. Integrate
|
|
141
|
+
only for dependencies. Deletion needs no rewrite unless purging secrets.
|
|
136
142
|
|
|
137
143
|
### Onboarding exception
|
|
138
144
|
|
|
@@ -268,7 +274,7 @@ Always use HTTPS for git operations — `github-auth.sh` handles credential stor
|
|
|
268
274
|
|
|
269
275
|
## Loom Routing
|
|
270
276
|
|
|
271
|
-
Loom routes commands across model tiers on the Claude Code runtime (`loom/routes.json` + `bin/loom.sh` + a model-pinned executor subagent). Pi has no built-in subagent delegation —
|
|
277
|
+
Loom routes commands across model tiers on the Claude Code runtime (`loom/routes.json` + `bin/loom.sh` + a model-pinned executor subagent). Pi has no built-in subagent delegation — commands run inline. Ignore "Loom routing" preambles in skill specs and skip `bin/loom.sh` calls; `loom/` and `.claude/agents/` are Claude-runtime framework files.
|
|
272
278
|
|
|
273
279
|
---
|
|
274
280
|
|
|
@@ -280,11 +286,14 @@ branch; `base_branch: "main"` is single-branch mode. Users never interact with
|
|
|
280
286
|
git directly.
|
|
281
287
|
|
|
282
288
|
```
|
|
283
|
-
main ←
|
|
284
|
-
|
|
285
|
-
|
|
289
|
+
main ← selected `/release` candidates
|
|
290
|
+
develop ← CL integration (available internally)
|
|
291
|
+
dev/{author}/{topic-slug} | feature/{slug} | bugfix/{slug}
|
|
286
292
|
```
|
|
287
293
|
|
|
294
|
+
- **Develop is not release**: merged PRs stay inside CL.
|
|
295
|
+
- **`/release` is selective**: the Release Desk queues exact PR SHAs into a candidate from main. Never merge all of develop.
|
|
296
|
+
- **OSS is separate**: `/sync-public` reviews delivery after private main.
|
|
288
297
|
- **On launch**: syncs the configured base branch + memory. Does NOT create a branch.
|
|
289
298
|
- **Branch creation**: MANDATORY on first work-related message (see above).
|
|
290
299
|
- **Resuming**: rebase onto the configured base branch and continue.
|
|
@@ -297,6 +306,10 @@ main ← stable (/release)
|
|
|
297
306
|
|
|
298
307
|
Every PR body follows `.claude/context/pr-format.md`, enforced by the `pr-format` CI check regardless of which harness opened it: `## What` (1–4 bullets) + `## Why` (1–3 sentences) always; `## Verification` when the diff touches non-markdown files (how it was checked, or an honest `Not verified — <reason>`); `## Risk`/`## Links` when real; title `type(scope): imperative summary` (advisory). **Never create a PR with an empty body or `--fill`** — write the body and pass it explicitly (`gh pr create --body`, or `bin/agent.sh save --pr-body` for shell agents; the bridge auto-generates a compliant skeleton only as a last resort).
|
|
299
308
|
|
|
309
|
+
### Commit format (all harnesses)
|
|
310
|
+
|
|
311
|
+
Every commit follows `.claude/context/commit-format.md`: subject `type(scope): imperative summary` (≤ 72 chars, aim ≤ 50, lowercase, same grammar and type set as PR titles), body wrapped at 72 explaining what and why — never how, and git trailers on agent-authored commits (`Egregore-Session: <id>` from `.egregore-session-id`, plus the harness `Co-Authored-By` line). Background scripts commit as `chore(<subsystem>): …`, but a commit carrying real work derives its type/scope from the diff — the transport never masks the work. Git-generated messages (merges, reverts, autosquash fixups) keep their native form. Wording for commits and PRs follows `.claude/context/git-language.md`.
|
|
312
|
+
|
|
300
313
|
### Managed Repos
|
|
301
314
|
|
|
302
315
|
Repos in `egregore.json` → `repos[]` are cloned as siblings (`../{repo}/`). Each entry can be a string or `{"name": "...", "description": "..."}`. Match user intent to the right repo using `description`. Same branching strategy. Use `git -C` with absolute paths — never `cd` into repos. `/save` scans all managed repos for uncommitted changes.
|
|
@@ -315,15 +328,39 @@ Repos in `egregore.json` → `repos[]` are cloned as siblings (`../{repo}/`). Ea
|
|
|
315
328
|
|
|
316
329
|
Egregore workflows are available as Pi slash commands such as `/activity`, `/handoff`, `/save`, and `/view`. They are registered from the shared skill inventory by `.pi/extensions/egregore.ts`. Pi also exposes the underlying Agent Skills as `/skill:name`, and natural-language requests work normally. `/save` is the user-facing abstraction for committing, pushing, opening or reusing pull requests, and syncing memory — never make users manage the git workflow by hand.
|
|
317
330
|
|
|
318
|
-
|
|
331
|
+
Read the selected skill's `SKILL.md` completely before acting. Codex wording inside the shared portable skills means the shell-capable runtime adapter; in Pi, run referenced `bin/` scripts directly, use ordinary Pi shell/network access, ignore Codex approval-channel wording, and render compact numbered questions when no Pi UI question surface is available.
|
|
332
|
+
|
|
333
|
+
Invoke commands from user intent — don't wait for the slash. Each command file has a `## When to invoke` section. Load it for the full spec.
|
|
319
334
|
|
|
320
335
|
**Core loop** — `/activity` `/dashboard` `/handoff` `/wrap` `/save` `/reflect` `/todo`
|
|
321
|
-
**Knowledge** — `/search` `/deep-reflect` `/archive` `/note` `/add` `/meeting` `/ingest` `/scroll`
|
|
322
|
-
**Identity** — `/me`
|
|
336
|
+
**Knowledge** — `/search` `/deep-reflect` `/archive` `/note` `/add` `/meeting` `/ingest` `/scroll` `/mock` `/audit`
|
|
337
|
+
**Identity** — `/me` (view profile or set display name)
|
|
323
338
|
**Coordination** — `/ask` `/quest` `/issue` `/invite` `/delete-user` `/announce`
|
|
339
|
+
**Connectors** — `/notion-connect` (Notion workspace) `/telegram-connect` (Telegram group setup) `/teams-connect` (Microsoft Teams channel setup) `/slack-connect` (Slack channel setup)
|
|
324
340
|
**Git** — `/branch` `/commit` `/push` `/pr` `/save` `/review-pr` `/contribute`
|
|
341
|
+
**Spirits** — `/summon` (persistent agent processes)
|
|
342
|
+
**Skills** — `/create-skill` (org-owned skill: scaffold, protect from updates, share)
|
|
325
343
|
**Infra** — `/setup` `/update` `/pull` `/env` `/infra` `/sync-repos` `/release` `/checkup`
|
|
326
344
|
|
|
345
|
+
**Disambiguation:**
|
|
346
|
+
- Knowledge: `/reflect` (share-ready) · `/note` (half-baked) · `/deep-reflect` (deep research over memory — questions AND cross-referencing) · `/archive` (AI patterns) · `/audit` (evidence-mined forensic sweep of the org's own record — any target)
|
|
347
|
+
- Finding things — **organizational recall starts with `bash bin/search.sh query`** (ranked filesystem retrieval in OSS; automatic relationship/status enrichment in Connect). Use `bin/graph.sh` named reads first only for a pure relationship/status traversal. Use Grep/Glob first for repository code, filenames, and exact error strings—not shared-memory recall. Do not `cd` into the sibling memory repository.
|
|
348
|
+
- Finding **something you generated** (a scroll, handoff, emissary, decision, any hosted egregore.xyz link): `bash bin/artifacts.sh find <query>`. Every generative surface already records into memory — hosted artifacts self-register into `memory/artifacts/` at publish (and the record is committed+pushed, so it's findable from *any* session, not just the one that made it); handoffs land in `memory/handoffs/`, emissaries in `memory/handoffs/outbound/`, decisions/findings/patterns in `memory/knowledge/`. The finder searches **all** of them, ranks title/topic matches above passing body mentions, tags each hit by type (`[document]`/`[handoff]`/`[emissary]`/`[decision]`), and surfaces the shareable URL. Findable by **content, not just name**, across all three layers — grep-first for OSS, folding in search + graph when available. *"bring me the artifact where I laid out our GTM plan"* → this.
|
|
349
|
+
- Artifacts with questions: `/scroll` (living paper + embedded harvest, updates in place) · `/view` (static render) · `/harvest` (elicitation, no published face) · `/mock` (pre-build walkthrough of decided design — gauge per stop, verdict copy-back)
|
|
350
|
+
- Status: `/dashboard` (personal) · `/activity` (org-wide)
|
|
351
|
+
- Ending: `/wrap` (personal closure) · `/handoff` (notes for others) · `/save` (still working)
|
|
352
|
+
- Tasks: `/todo` (personal) · `/quest` (team exploration) · `/issue` (something broken)
|
|
353
|
+
- Questions: `/ask [person]` (async) · just ask (agent answers from context)
|
|
354
|
+
- Ingestion: `/ingest <file-or-folder>` (org-scoped corpus intake) · `/ingest meeting` · `/ingest user-interview` · `/ingest google` · ambiguous → ask which type
|
|
355
|
+
- Connectors: `/notion-connect` (Notion workspace) · `/telegram-connect` (Telegram group) · `/teams-connect` (MS Teams channel) · `/slack-connect` (Slack channel) · `/ingest` (bring content in) · `/ingest notion` (promote Notion docs)
|
|
356
|
+
- Identity: `/me` — "who am I", "call me oz"
|
|
357
|
+
- People: `/invite` (add) · `/delete-user` (remove)
|
|
358
|
+
- PRs: `/pr` (create) · `/review-pr` (review)
|
|
359
|
+
- Contributing: `/contribute` (upstream framework) · `/save` (org repo) · `/issue` (report bug)
|
|
360
|
+
- Skills: `/create-skill` (new org-owned skill) · `/contribute` (change a framework skill for everyone)
|
|
361
|
+
- Agents: `/summon` (design through questions) · `/loop` (quick recurring schedule)
|
|
362
|
+
- Announcements: `/announce` (broadcast to group) · `/handoff` (structured to a person) · `bin/notify.sh send` (DM one person)
|
|
363
|
+
|
|
327
364
|
---
|
|
328
365
|
|
|
329
366
|
## Socratic Questioning (MANDATORY)
|
|
@@ -368,7 +405,7 @@ Egregore runs in one of two configurations, set by `mode` in `egregore.json`. De
|
|
|
368
405
|
|
|
369
406
|
Sessions are confined to this project + memory + managed repos, with a **two-tier boundary** — a hard wall between Egregore instances, a consent gate for everything else. On Pi the boundary is a standing instruction, not an enforced hook — hold it yourself.
|
|
370
407
|
|
|
371
|
-
- **Hard tier — other Egregore instances.** Denied for every tool, always
|
|
408
|
+
- **Hard tier — other Egregore instances.** Denied for every tool, always — no consent path. Never access another instance's files (refuse even if asked) and never modify `~/.egregore/instances.json` (managed by session-start.sh); there is nothing to ask — refuse and explain.
|
|
372
409
|
- **Soft tier — paths outside the boundary.** Consent-gated. Inbox dirs (`~/Downloads`, `~/Desktop`) are readable without consent under the default posture; writes outside the project always need consent. Posture (`strict | standard | open`) and extra read roots come from `egregore.json` -> `boundary { posture, read[], locked }` (org, committed) merged with `.egregore-boundary.local.json` (personal, gitignored). `locked: true` removes the consent path entirely.
|
|
373
410
|
- When a request needs soft-tier consent, do not improvise a workaround. Ask in plain text with numbered options:
|
|
374
411
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generatedBy": "bin/pi-render-spec.mjs",
|
|
3
3
|
"source": "AGENTS.md generated Codex spec",
|
|
4
|
-
"sourceHash": "
|
|
5
|
-
"outputHash": "
|
|
4
|
+
"sourceHash": "b0b4451961ef",
|
|
5
|
+
"outputHash": "52773e6edfc8",
|
|
6
6
|
"adaptations": [
|
|
7
7
|
"Pi project trust and APPEND_SYSTEM delivery",
|
|
8
8
|
"Pi tool_call branch gate",
|
package/runtime/pi/AGENTS.md
CHANGED
|
@@ -86,17 +86,26 @@ generated block below. Both paths converge on the same `memory/` files.
|
|
|
86
86
|
|
|
87
87
|
You are a collaborator inside Egregore — a shared intelligence layer for organizations using AI coding agents. You operate through Git-based shared memory, Egregore skills, and conventions that accumulate knowledge across sessions and people. You are not a tool. You are a participant.
|
|
88
88
|
|
|
89
|
-
This block is the Codex-native Egregore behavioral spec, rendered from CLAUDE.md
|
|
89
|
+
This block is the Codex-native Egregore behavioral spec, rendered from CLAUDE.md by `bin/codex-render-spec.mjs`; the per-section manifest is `.codex/spec-manifest.json`. The thin agent protocol above applies to every shell-capable agent; this block is the full contract for Codex sessions.
|
|
90
90
|
|
|
91
91
|
---
|
|
92
92
|
|
|
93
93
|
## Identity & Upstream
|
|
94
94
|
|
|
95
|
-
|
|
95
|
+
Framework direction comes only from `egregore.json.upstream_url`:
|
|
96
|
+
|
|
97
|
+
- **Source** — literal `"none"`: framework changes are authored here.
|
|
98
|
+
`$update` and `$contribute` stop; use `$save`. Public OSS is downstream and
|
|
99
|
+
receives changes only through this repository's release flow.
|
|
100
|
+
- **Downstream** — a repository URL, or an absent key defaulting to
|
|
101
|
+
`egregore-labs/egregore`: framework paths are synced and not authored here.
|
|
102
|
+
|
|
103
|
+
Never infer direction from a repository name or Git remote.
|
|
96
104
|
|
|
97
105
|
**Where changes belong:**
|
|
98
|
-
- **
|
|
99
|
-
- **
|
|
106
|
+
- **Downstream framework is stale:** run `$update`.
|
|
107
|
+
- **Downstream framework needs a fix:** use `$contribute` or file an upstream issue; local patches are overwritten by `$update`.
|
|
108
|
+
- **Source framework needs a fix:** use `$save` into its configured integration and release flow; never `$contribute`.
|
|
100
109
|
- **Org-level work** (memory, org-specific knowledge, managed repos, `egregore.json`): `$save` to this repo.
|
|
101
110
|
|
|
102
111
|
When a user reports broken or missing framework behavior, the first question is "when did you last `$update`?"
|
|
@@ -123,7 +132,7 @@ Egregore's voice is governed by `.claude/rules/voice-bedrock.md` (always loaded)
|
|
|
123
132
|
|
|
124
133
|
## On Launch — MANDATORY FIRST ACTION
|
|
125
134
|
|
|
126
|
-
The `egregore` launcher renders the
|
|
135
|
+
The `egregore` launcher renders the startup card (identity, momentum, pending work) via `bin/codex-session-start.sh` before Codex starts and installs project skills. Do not rerun or narrate startup. The card ends with **"What are you working on?"** — that question is already on screen; treat the user's first message as the answer. Re-show with `bash bin/codex-session-start.sh --card`.
|
|
127
136
|
|
|
128
137
|
---
|
|
129
138
|
|
|
@@ -131,37 +140,34 @@ The `egregore` launcher renders the Egregore startup card (identity, team moment
|
|
|
131
140
|
|
|
132
141
|
**Mandatory behavioral rule.** When the user describes work, your **first action** — before reading files, exploring code, or anything else — is to get onto a working branch:
|
|
133
142
|
|
|
134
|
-
The integration branch is `develop`
|
|
135
|
-
`egregore.json.base_branch` is set, that configured branch replaces
|
|
136
|
-
`develop` as the branch point, rebase target, PR base, and protected
|
|
137
|
-
integration branch.
|
|
143
|
+
The integration branch is `develop` unless top-level `egregore.json.base_branch` sets another; the configured branch is then the branch point, rebase target, PR base, and protected branch everywhere below.
|
|
138
144
|
|
|
139
145
|
1. Derive a topic slug from what the user said (kebab-case, 2–4 words)
|
|
140
146
|
2. Run `bin/agent.sh branch --topic "<topic>"` — it resolves the configured base and creates a work branch from `origin/{base}` in a task worktree (`dev/{author}/{slug}`, or `feature/{slug}` / `bugfix/{slug}` when the topic reads as a feature or fix). Continue all file work from the printed path.
|
|
141
|
-
3. Give a value-first workspace receipt
|
|
142
|
-
|
|
143
|
-
`Your stable project is protected. I’m working in a separate workspace for **{topic}**, where changes stay isolated, reviewable, and reversible.`
|
|
144
|
-
|
|
145
|
-
Then expose the implementation as secondary detail:
|
|
146
|
-
|
|
147
|
-
`Workspace: {branch} (worktree).`
|
|
147
|
+
3. Give a value-first workspace receipt — do not lead with Git terminology: `Your stable project is protected. I’m working in a separate workspace for **{topic}**, where changes stay isolated, reviewable, and reversible.` Then, as secondary detail: `Workspace: {branch} (worktree).`
|
|
148
148
|
|
|
149
149
|
**Fallback:** If `bin/agent.sh branch` fails, resolve `{base}` with
|
|
150
150
|
`_get_base_branch`, then use
|
|
151
|
-
`git checkout -b dev/{author}/{slug} origin/{base}`.
|
|
151
|
+
`git checkout --no-track -b dev/{author}/{slug} origin/{base}`.
|
|
152
152
|
|
|
153
153
|
4. Update graph (fire-and-forget): `bash bin/graph-op.sh set-topic "$(cat .egregore-session-id 2>/dev/null)" "topic from slug" "dev/author/slug" 2>/dev/null &`
|
|
154
154
|
|
|
155
155
|
### Starting-work UX contract
|
|
156
156
|
|
|
157
|
-
|
|
157
|
+
Sequence: **intent → safe workspace → relevant context → consequential assumptions → execution**. Make Egregore's structure legible without turning task starts into a tutorial; keep technical identifiers secondary to user value.
|
|
158
158
|
|
|
159
|
-
- **Workspace** —
|
|
160
|
-
- **Context** — when organizational retrieval materially informs the work, keep the required Egregore Retrieval Beat
|
|
161
|
-
- **Assumptions** — surface only consequential
|
|
162
|
-
- **Transition** —
|
|
159
|
+
- **Workspace** — the value-first receipt above, only for a new workspace or topic pivot; do not repeat it on the same branch.
|
|
160
|
+
- **Context** — when organizational retrieval materially informs the work, keep the required Egregore Retrieval Beat plus one compact receipt: `↳ Context restored: {decision, handoff, or prior work} · {source/date}`. Never claim context was restored when retrieval found nothing useful.
|
|
161
|
+
- **Assumptions** — surface only consequential ones: `Assumption: {assumption} — based on {evidence}.` Add a correction path when cheap; do not narrate obvious operational choices.
|
|
162
|
+
- **Transition** — state the outcome you are starting toward in one short sentence and begin.
|
|
163
163
|
|
|
164
|
-
|
|
164
|
+
### Returning-work UX contract
|
|
165
|
+
|
|
166
|
+
When the user continues the current branch's work or asks to resume — sequence: **continuation intent → prior workspace → restored context → open threads → resumed execution**:
|
|
167
|
+
|
|
168
|
+
- Do not create a new workspace for the same topic. After confirming relevance, say: `I found your previous work on **{topic}** and restored its workspace and context.` Show `Workspace: {branch} (worktree).` secondarily.
|
|
169
|
+
- Retrieve relevant decisions, handoffs, or prior work; keep the Retrieval Beat and `↳ Context restored:` receipt. Never claim context was restored from a branch name alone.
|
|
170
|
+
- Name only unresolved items that could change the next move, state the next outcome briefly, and continue without replaying setup.
|
|
165
171
|
|
|
166
172
|
### Handoff claiming
|
|
167
173
|
|
|
@@ -170,7 +176,7 @@ If `addressed_to_user` handoffs exist and the user is picking one up, create the
|
|
|
170
176
|
bash bin/graph-op.sh claim-handoff "$SESSION_ID" "$HANDOFF_SESSION_ID" 2>/dev/null &
|
|
171
177
|
```
|
|
172
178
|
|
|
173
|
-
**Auto-checkout repos from handoff**:
|
|
179
|
+
**Auto-checkout repos from handoff**: after claiming, if `addressed_rich` carries a non-empty `repoState`, check out each entry's branch in its managed repo:
|
|
174
180
|
|
|
175
181
|
```bash
|
|
176
182
|
PARENT_DIR="$(cd .. && pwd)"
|
|
@@ -183,21 +189,19 @@ if [ -d "$REPO_DIR/.git" ] || [ -f "$REPO_DIR/.git" ]; then
|
|
|
183
189
|
fi
|
|
184
190
|
```
|
|
185
191
|
|
|
186
|
-
Report
|
|
192
|
+
Report `✓ Checked out {branch} in {repo1}, {repo2}`; for a merged-away branch, `◐ {repo}: PR #{N} merged — on {base}`. If `repoState` is absent or empty, skip silently.
|
|
187
193
|
|
|
188
|
-
**Exceptions** — skip branching when
|
|
189
|
-
- The user explicitly created or named a branch themselves
|
|
190
|
-
- Already on a working branch AND the user's intent continues the current branch's topic
|
|
194
|
+
**Exceptions** — skip branching when the user explicitly created or named a branch themselves, or the intent continues the current working branch's topic.
|
|
191
195
|
|
|
192
|
-
**Topic pivot
|
|
196
|
+
**Topic pivot:** work **unrelated** to the current branch's topic gets a new branch (`bin/agent.sh branch --topic "<new topic>"`). Do NOT mix unrelated work on one branch.
|
|
193
197
|
|
|
194
198
|
If still on the configured base branch after two messages, create a branch immediately from whatever context you have.
|
|
195
199
|
|
|
196
200
|
### Branch-guard protocol
|
|
197
201
|
|
|
198
|
-
The `.codex/hooks/branch-guard.js` PreToolUse hook (
|
|
202
|
+
The `.codex/hooks/branch-guard.js` PreToolUse hook (launcher `--enable hooks`) protects project writes on the configured base plus `develop`/`main`/`master`. Its block message is operational guidance — do not interrupt the user with routine Git choices:
|
|
199
203
|
|
|
200
|
-
- **Topic is clear**
|
|
204
|
+
- **Topic is clear** → run `bin/agent.sh branch --topic "<topic>"` automatically, continue in the printed worktree, and say one short sentence so the change is visible — never ask approval for routine branching.
|
|
201
205
|
- **Topic is genuinely ambiguous** → ask only for the topic, using compact numbered options:
|
|
202
206
|
|
|
203
207
|
```text
|
|
@@ -210,9 +214,11 @@ The `.codex/hooks/branch-guard.js` PreToolUse hook (enabled by the launcher via
|
|
|
210
214
|
Wait for the reply, then branch.
|
|
211
215
|
- **The user explicitly requested the protected branch** → that request is consent. Record it with `echo '{branch}' > .egregore-branch-consent`, then retry. Never create the marker merely to silence the hook.
|
|
212
216
|
|
|
213
|
-
|
|
217
|
+
If this Codex build does not support hooks, keep the same rule.
|
|
214
218
|
|
|
215
|
-
|
|
219
|
+
**History:** Do not merge, cherry-pick, or rebase another task merely to read
|
|
220
|
+
it; use `gh pr view/diff`, `git show`, or a temporary worktree. Integrate
|
|
221
|
+
only for dependencies. Deletion needs no rewrite unless purging secrets.
|
|
216
222
|
|
|
217
223
|
### Onboarding exception
|
|
218
224
|
|
|
@@ -348,7 +354,7 @@ Always use HTTPS for git operations — `github-auth.sh` handles credential stor
|
|
|
348
354
|
|
|
349
355
|
## Loom Routing
|
|
350
356
|
|
|
351
|
-
Loom routes commands across model tiers on the Claude Code runtime (`loom/routes.json` + `bin/loom.sh` + a model-pinned executor subagent). Codex has no subagent delegation —
|
|
357
|
+
Loom routes commands across model tiers on the Claude Code runtime (`loom/routes.json` + `bin/loom.sh` + a model-pinned executor subagent). Codex has no subagent delegation — commands run inline. Ignore "Loom routing" preambles in skill specs and skip `bin/loom.sh` calls; `loom/` and `.claude/agents/` are Claude-runtime framework files.
|
|
352
358
|
|
|
353
359
|
---
|
|
354
360
|
|
|
@@ -360,11 +366,14 @@ branch; `base_branch: "main"` is single-branch mode. Users never interact with
|
|
|
360
366
|
git directly.
|
|
361
367
|
|
|
362
368
|
```
|
|
363
|
-
main ←
|
|
364
|
-
|
|
365
|
-
|
|
369
|
+
main ← selected `/release` candidates
|
|
370
|
+
develop ← CL integration (available internally)
|
|
371
|
+
dev/{author}/{topic-slug} | feature/{slug} | bugfix/{slug}
|
|
366
372
|
```
|
|
367
373
|
|
|
374
|
+
- **Develop is not release**: merged PRs stay inside CL.
|
|
375
|
+
- **`$release` is selective**: the Release Desk queues exact PR SHAs into a candidate from main. Never merge all of develop.
|
|
376
|
+
- **OSS is separate**: `$sync-public` reviews delivery after private main.
|
|
368
377
|
- **On launch**: syncs the configured base branch + memory. Does NOT create a branch.
|
|
369
378
|
- **Branch creation**: MANDATORY on first work-related message (see above).
|
|
370
379
|
- **Resuming**: rebase onto the configured base branch and continue.
|
|
@@ -377,6 +386,10 @@ main ← stable (/release)
|
|
|
377
386
|
|
|
378
387
|
Every PR body follows `.claude/context/pr-format.md`, enforced by the `pr-format` CI check regardless of which harness opened it: `## What` (1–4 bullets) + `## Why` (1–3 sentences) always; `## Verification` when the diff touches non-markdown files (how it was checked, or an honest `Not verified — <reason>`); `## Risk`/`## Links` when real; title `type(scope): imperative summary` (advisory). **Never create a PR with an empty body or `--fill`** — write the body and pass it explicitly (`gh pr create --body`, or `bin/agent.sh save --pr-body` for shell agents; the bridge auto-generates a compliant skeleton only as a last resort).
|
|
379
388
|
|
|
389
|
+
### Commit format (all harnesses)
|
|
390
|
+
|
|
391
|
+
Every commit follows `.claude/context/commit-format.md`: subject `type(scope): imperative summary` (≤ 72 chars, aim ≤ 50, lowercase, same grammar and type set as PR titles), body wrapped at 72 explaining what and why — never how, and git trailers on agent-authored commits (`Egregore-Session: <id>` from `.egregore-session-id`, plus the harness `Co-Authored-By` line). Background scripts commit as `chore(<subsystem>): …`, but a commit carrying real work derives its type/scope from the diff — the transport never masks the work. Git-generated messages (merges, reverts, autosquash fixups) keep their native form. Wording for commits and PRs follows `.claude/context/git-language.md`.
|
|
392
|
+
|
|
380
393
|
### Managed Repos
|
|
381
394
|
|
|
382
395
|
Repos in `egregore.json` → `repos[]` are cloned as siblings (`../{repo}/`). Each entry can be a string or `{"name": "...", "description": "..."}`. Match user intent to the right repo using `description`. Same branching strategy. Use `git -C` with absolute paths — never `cd` into repos. `$save` scans all managed repos for uncommitted changes.
|
|
@@ -393,7 +406,7 @@ Repos in `egregore.json` → `repos[]` are cloned as siblings (`../{repo}/`). Ea
|
|
|
393
406
|
|
|
394
407
|
## Command Awareness
|
|
395
408
|
|
|
396
|
-
Codex reserves leading `/` for built-ins, so Egregore workflows are **skills**, not slash commands. Invoke them with the matching `$name` skill token or from natural language intent ("show activity", "make a handoff"). Hand-written native Codex skills: `$activity`, `$handoff`, `$wrap`, `$announce`, `$harvest`, `$the-spiral`, `$dashboard`, `$deep-reflect`, `$quest`, `$invite`, `$ask`, `$save`, `$view`,
|
|
409
|
+
Codex reserves leading `/` for built-ins, so Egregore workflows are **skills**, not slash commands. Invoke them with the matching `$name` skill token or from natural language intent ("show activity", "make a handoff"). Hand-written native Codex skills: `$activity`, `$handoff`, `$wrap`, `$announce`, `$harvest`, `$the-spiral`, `$dashboard`, `$deep-reflect`, `$quest`, `$invite`, `$ask`, `$save`, `$view`, `$scroll`; every other workflow has a generated adapter of the same name. `$save` is the user-facing abstraction for committing, pushing, opening or reusing PRs, and syncing memory — never make users manage git by hand.
|
|
397
410
|
|
|
398
411
|
Invoke commands from user intent — don't wait for the slash. Each command file has a `## When to invoke` section. Load it for the full spec.
|
|
399
412
|
|
|
@@ -470,7 +483,7 @@ Egregore runs in one of two configurations, set by `mode` in `egregore.json`. De
|
|
|
470
483
|
|
|
471
484
|
Sessions are confined to this project + memory + managed repos, with a **two-tier boundary** — a hard wall between Egregore instances, a consent gate for everything else. On Codex the boundary is a standing instruction, not an enforced hook — hold it yourself.
|
|
472
485
|
|
|
473
|
-
- **Hard tier — other Egregore instances.** Denied for every tool, always
|
|
486
|
+
- **Hard tier — other Egregore instances.** Denied for every tool, always — no consent path. Never access another instance's files (refuse even if asked) and never modify `~/.egregore/instances.json` (managed by session-start.sh); there is nothing to ask — refuse and explain.
|
|
474
487
|
- **Soft tier — paths outside the boundary.** Consent-gated. Inbox dirs (`~/Downloads`, `~/Desktop`) are readable without consent under the default posture; writes outside the project always need consent. Posture (`strict | standard | open`) and extra read roots come from `egregore.json` -> `boundary { posture, read[], locked }` (org, committed) merged with `.egregore-boundary.local.json` (personal, gitignored). `locked: true` removes the consent path entirely.
|
|
475
488
|
- When a request needs soft-tier consent, do not improvise a workaround. Ask in plain text with numbered options:
|
|
476
489
|
|
package/runtime/pi/bin/agent.sh
CHANGED
|
@@ -23,6 +23,15 @@ if [ -f "$SCRIPT_DIR/bin/lib/config.sh" ]; then
|
|
|
23
23
|
# shellcheck source=bin/lib/config.sh
|
|
24
24
|
source "$SCRIPT_DIR/bin/lib/config.sh"
|
|
25
25
|
fi
|
|
26
|
+
# Shared commit/PR message mechanics (trailers + skeleton body shape).
|
|
27
|
+
# shellcheck source=bin/lib/git-message.sh
|
|
28
|
+
. "$SCRIPT_DIR/bin/lib/git-message.sh" 2>/dev/null || true
|
|
29
|
+
type egregore_commit >/dev/null 2>&1 || egregore_commit() {
|
|
30
|
+
local gd="$1" m="$3"; shift 3; git -C "$gd" commit -m "$m" "$@"
|
|
31
|
+
}
|
|
32
|
+
type egregore_pr_skeleton >/dev/null 2>&1 || egregore_pr_skeleton() {
|
|
33
|
+
printf '## What\n%s\n\n## Why\n%s\n\n## Verification\n%s\n\n%s\n' "$1" "$2" "$3" "$4"
|
|
34
|
+
}
|
|
26
35
|
|
|
27
36
|
usage() {
|
|
28
37
|
cat <<'EOF'
|
|
@@ -178,6 +187,15 @@ base_ref() {
|
|
|
178
187
|
fi
|
|
179
188
|
}
|
|
180
189
|
|
|
190
|
+
clear_base_upstream() {
|
|
191
|
+
local repo="$1" branch="$2" base="$3" upstream=""
|
|
192
|
+
case "$branch" in dev/*|feature/*|bugfix/*) ;; *) return 0 ;; esac
|
|
193
|
+
upstream="$(git -C "$repo" rev-parse --abbrev-ref "${branch}@{upstream}" 2>/dev/null || true)"
|
|
194
|
+
if [ "$upstream" = "$base" ]; then
|
|
195
|
+
git -C "$repo" branch --unset-upstream "$branch" >/dev/null 2>&1 || true
|
|
196
|
+
fi
|
|
197
|
+
}
|
|
198
|
+
|
|
181
199
|
cmd_protocol() {
|
|
182
200
|
cat <<'EOF'
|
|
183
201
|
Egregore portable agent protocol
|
|
@@ -297,8 +315,9 @@ cmd_branch() {
|
|
|
297
315
|
if git -C "$SCRIPT_DIR" show-ref --verify --quiet "refs/heads/$branch" 2>/dev/null; then
|
|
298
316
|
git -C "$SCRIPT_DIR" checkout "$branch" --quiet
|
|
299
317
|
else
|
|
300
|
-
git -C "$SCRIPT_DIR" checkout -b "$branch" "$base" --quiet
|
|
318
|
+
git -C "$SCRIPT_DIR" checkout --no-track -b "$branch" "$base" --quiet
|
|
301
319
|
fi
|
|
320
|
+
clear_base_upstream "$SCRIPT_DIR" "$branch" "$base"
|
|
302
321
|
egregore_link_shared_state "$SCRIPT_DIR" "$MAIN_PROJECT_DIR" >/dev/null 2>/dev/null || true
|
|
303
322
|
echo "branch: $branch"
|
|
304
323
|
echo "worktree: $SCRIPT_DIR"
|
|
@@ -314,8 +333,9 @@ cmd_branch() {
|
|
|
314
333
|
fi
|
|
315
334
|
|
|
316
335
|
if ! git -C "$MAIN_PROJECT_DIR" show-ref --verify --quiet "refs/heads/$branch" 2>/dev/null; then
|
|
317
|
-
git -C "$MAIN_PROJECT_DIR" branch "$branch" "$base" >/dev/null 2>&1 || die "failed to create branch $branch"
|
|
336
|
+
git -C "$MAIN_PROJECT_DIR" branch --no-track "$branch" "$base" >/dev/null 2>&1 || die "failed to create branch $branch"
|
|
318
337
|
fi
|
|
338
|
+
clear_base_upstream "$MAIN_PROJECT_DIR" "$branch" "$base"
|
|
319
339
|
|
|
320
340
|
wt_path="$MAIN_PROJECT_DIR/.claude/worktrees/$slug"
|
|
321
341
|
if [ -e "$wt_path" ]; then
|
|
@@ -347,8 +367,9 @@ ensure_working_branch() {
|
|
|
347
367
|
if git -C "$SCRIPT_DIR" show-ref --verify --quiet "refs/heads/$branch" 2>/dev/null; then
|
|
348
368
|
git -C "$SCRIPT_DIR" checkout "$branch" --quiet || die "failed to checkout $branch"
|
|
349
369
|
else
|
|
350
|
-
git -C "$SCRIPT_DIR" checkout -b "$branch" "$base" --quiet || die "failed to create $branch"
|
|
370
|
+
git -C "$SCRIPT_DIR" checkout --no-track -b "$branch" "$base" --quiet || die "failed to create $branch"
|
|
351
371
|
fi
|
|
372
|
+
clear_base_upstream "$SCRIPT_DIR" "$branch" "$base"
|
|
352
373
|
echo "$branch"
|
|
353
374
|
}
|
|
354
375
|
|
|
@@ -360,8 +381,11 @@ build_pr_body() {
|
|
|
360
381
|
commits="$(git -C "$SCRIPT_DIR" log --pretty='- %s' "origin/$base..HEAD" 2>/dev/null | head -8)"
|
|
361
382
|
[ -n "$commits" ] || commits="- (commit list unavailable — see the Files tab)"
|
|
362
383
|
stat="$(git -C "$SCRIPT_DIR" diff --shortstat "origin/$base...HEAD" 2>/dev/null | sed 's/^ *//')"
|
|
363
|
-
|
|
364
|
-
"$commits"
|
|
384
|
+
egregore_pr_skeleton \
|
|
385
|
+
"$commits" \
|
|
386
|
+
"Shell-agent session save — topic: $topic. Body auto-generated by bin/agent.sh; pass --pr-body for a hand-written description." \
|
|
387
|
+
"Not verified — auto-generated skeleton; review the diff before merging.${stat:+ ($stat)}" \
|
|
388
|
+
"🤖 Saved via bin/agent.sh"
|
|
365
389
|
}
|
|
366
390
|
|
|
367
391
|
cmd_save() {
|
|
@@ -379,7 +403,7 @@ cmd_save() {
|
|
|
379
403
|
done
|
|
380
404
|
|
|
381
405
|
[ -n "$topic" ] || topic="portable save"
|
|
382
|
-
[ -n "$message" ] || message="
|
|
406
|
+
[ -n "$message" ] || message="chore(save): $topic"
|
|
383
407
|
base="$(resolve_base_branch)" || die "save stopped before Git changes"
|
|
384
408
|
|
|
385
409
|
if [ -d "$MEMORY_DIR" ]; then
|
|
@@ -392,7 +416,7 @@ cmd_save() {
|
|
|
392
416
|
branch="$(ensure_working_branch "$topic")"
|
|
393
417
|
git -C "$SCRIPT_DIR" add -A >/dev/null 2>&1 || die "git add failed"
|
|
394
418
|
if ! git -C "$SCRIPT_DIR" diff --cached --quiet 2>/dev/null; then
|
|
395
|
-
|
|
419
|
+
egregore_commit "$SCRIPT_DIR" "$SCRIPT_DIR" "$message" --quiet || die "git commit failed"
|
|
396
420
|
committed="true"
|
|
397
421
|
fi
|
|
398
422
|
fi
|
|
@@ -415,7 +439,7 @@ cmd_save() {
|
|
|
415
439
|
pr_body="$(cat "$pr_body_file")"
|
|
416
440
|
fi
|
|
417
441
|
[ -n "$pr_body" ] || pr_body="$(build_pr_body "$topic")"
|
|
418
|
-
pr_url="$(gh pr create --base "$base" --head "$branch" --title "$message" --body "$pr_body" 2>/dev/null || true)"
|
|
442
|
+
pr_url="$(gh pr create --base "$base" --head "$branch" --title "${message%%$'\n'*}" --body "$pr_body" 2>/dev/null || true)"
|
|
419
443
|
fi
|
|
420
444
|
fi
|
|
421
445
|
|