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
|
@@ -179,43 +179,40 @@ function transformTokens(body) {
|
|
|
179
179
|
|
|
180
180
|
const INTRO_BODY = `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.
|
|
181
181
|
|
|
182
|
-
This block is the Codex-native Egregore behavioral spec, rendered from CLAUDE.md
|
|
182
|
+
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.`;
|
|
183
183
|
|
|
184
|
-
const ON_LAUNCH_BODY = `The \`egregore\` launcher renders the
|
|
184
|
+
const ON_LAUNCH_BODY = `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\`.`;
|
|
185
185
|
|
|
186
186
|
const AFTER_GREETING_BODY = `**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:
|
|
187
187
|
|
|
188
|
-
The integration branch is \`develop\`
|
|
189
|
-
\`egregore.json.base_branch\` is set, that configured branch replaces
|
|
190
|
-
\`develop\` as the branch point, rebase target, PR base, and protected
|
|
191
|
-
integration branch.
|
|
188
|
+
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.
|
|
192
189
|
|
|
193
190
|
1. Derive a topic slug from what the user said (kebab-case, 2ā4 words)
|
|
194
191
|
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.
|
|
195
|
-
3. Give a value-first workspace receipt
|
|
196
|
-
|
|
197
|
-
\`Your stable project is protected. Iām working in a separate workspace for **{topic}**, where changes stay isolated, reviewable, and reversible.\`
|
|
198
|
-
|
|
199
|
-
Then expose the implementation as secondary detail:
|
|
200
|
-
|
|
201
|
-
\`Workspace: {branch} (worktree).\`
|
|
192
|
+
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).\`
|
|
202
193
|
|
|
203
194
|
**Fallback:** If \`bin/agent.sh branch\` fails, resolve \`{base}\` with
|
|
204
195
|
\`_get_base_branch\`, then use
|
|
205
|
-
\`git checkout -b dev/{author}/{slug} origin/{base}\`.
|
|
196
|
+
\`git checkout --no-track -b dev/{author}/{slug} origin/{base}\`.
|
|
206
197
|
|
|
207
198
|
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 &\`
|
|
208
199
|
|
|
209
200
|
### Starting-work UX contract
|
|
210
201
|
|
|
211
|
-
|
|
202
|
+
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.
|
|
203
|
+
|
|
204
|
+
- **Workspace** ā the value-first receipt above, only for a new workspace or topic pivot; do not repeat it on the same branch.
|
|
205
|
+
- **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.
|
|
206
|
+
- **Assumptions** ā surface only consequential ones: \`Assumption: {assumption} ā based on {evidence}.\` Add a correction path when cheap; do not narrate obvious operational choices.
|
|
207
|
+
- **Transition** ā state the outcome you are starting toward in one short sentence and begin.
|
|
208
|
+
|
|
209
|
+
### Returning-work UX contract
|
|
212
210
|
|
|
213
|
-
|
|
214
|
-
- **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.
|
|
215
|
-
- **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.
|
|
216
|
-
- **Transition** ā once workspace, context, and assumptions are settled, state the outcome you are starting toward in one short sentence and begin.
|
|
211
|
+
When the user continues the current branch's work or asks to resume ā sequence: **continuation intent ā prior workspace ā restored context ā open threads ā resumed execution**:
|
|
217
212
|
|
|
218
|
-
|
|
213
|
+
- 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.
|
|
214
|
+
- 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.
|
|
215
|
+
- Name only unresolved items that could change the next move, state the next outcome briefly, and continue without replaying setup.
|
|
219
216
|
|
|
220
217
|
### Handoff claiming
|
|
221
218
|
|
|
@@ -224,7 +221,7 @@ If \`addressed_to_user\` handoffs exist and the user is picking one up, create t
|
|
|
224
221
|
bash bin/graph-op.sh claim-handoff "$SESSION_ID" "$HANDOFF_SESSION_ID" 2>/dev/null &
|
|
225
222
|
\`\`\`
|
|
226
223
|
|
|
227
|
-
**Auto-checkout repos from handoff**:
|
|
224
|
+
**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:
|
|
228
225
|
|
|
229
226
|
\`\`\`bash
|
|
230
227
|
PARENT_DIR="$(cd .. && pwd)"
|
|
@@ -237,21 +234,19 @@ if [ -d "$REPO_DIR/.git" ] || [ -f "$REPO_DIR/.git" ]; then
|
|
|
237
234
|
fi
|
|
238
235
|
\`\`\`
|
|
239
236
|
|
|
240
|
-
Report
|
|
237
|
+
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.
|
|
241
238
|
|
|
242
|
-
**Exceptions** ā skip branching when
|
|
243
|
-
- The user explicitly created or named a branch themselves
|
|
244
|
-
- Already on a working branch AND the user's intent continues the current branch's topic
|
|
239
|
+
**Exceptions** ā skip branching when the user explicitly created or named a branch themselves, or the intent continues the current working branch's topic.
|
|
245
240
|
|
|
246
|
-
**Topic pivot
|
|
241
|
+
**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.
|
|
247
242
|
|
|
248
243
|
If still on the configured base branch after two messages, create a branch immediately from whatever context you have.
|
|
249
244
|
|
|
250
245
|
### Branch-guard protocol
|
|
251
246
|
|
|
252
|
-
The \`.codex/hooks/branch-guard.js\` PreToolUse hook (
|
|
247
|
+
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:
|
|
253
248
|
|
|
254
|
-
- **Topic is clear**
|
|
249
|
+
- **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.
|
|
255
250
|
- **Topic is genuinely ambiguous** ā ask only for the topic, using compact numbered options:
|
|
256
251
|
|
|
257
252
|
\`\`\`text
|
|
@@ -264,15 +259,17 @@ The \`.codex/hooks/branch-guard.js\` PreToolUse hook (enabled by the launcher vi
|
|
|
264
259
|
Wait for the reply, then branch.
|
|
265
260
|
- **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.
|
|
266
261
|
|
|
267
|
-
|
|
262
|
+
If this Codex build does not support hooks, keep the same rule.
|
|
268
263
|
|
|
269
|
-
|
|
264
|
+
**History:** Do not merge, cherry-pick, or rebase another task merely to read
|
|
265
|
+
it; use \`gh pr view/diff\`, \`git show\`, or a temporary worktree. Integrate
|
|
266
|
+
only for dependencies. Deletion needs no rewrite unless purging secrets.
|
|
270
267
|
|
|
271
268
|
### Onboarding exception
|
|
272
269
|
|
|
273
270
|
If the startup card output contains \`onboarding_needed\`, invoke the \`$onboarding\` skill instead of greeting.`;
|
|
274
271
|
|
|
275
|
-
const COMMAND_AWARENESS_PREPEND = `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\`,
|
|
272
|
+
const COMMAND_AWARENESS_PREPEND = `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.`;
|
|
276
273
|
|
|
277
274
|
const SOCRATIC_BODY = `**Triggers**: "ask me questions", "question me", "help me think through", or any request to be questioned.
|
|
278
275
|
|
|
@@ -280,11 +277,11 @@ Codex has no structured question tool ā render each batch as compact numbered
|
|
|
280
277
|
|
|
281
278
|
**Rules:** Max 4 questions per batch. When choices aren't mutually exclusive, say "pick any that apply".`;
|
|
282
279
|
|
|
283
|
-
const LOOM_ROUTING_BODY = `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 ā
|
|
280
|
+
const LOOM_ROUTING_BODY = `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.`;
|
|
284
281
|
|
|
285
282
|
const ISOLATION_BODY = `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.
|
|
286
283
|
|
|
287
|
-
- **Hard tier ā other Egregore instances.** Denied for every tool, always
|
|
284
|
+
- **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.
|
|
288
285
|
- **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.
|
|
289
286
|
- When a request needs soft-tier consent, do not improvise a workaround. Ask in plain text with numbered options:
|
|
290
287
|
|
|
@@ -327,7 +324,7 @@ const RULES = {
|
|
|
327
324
|
'After Greeting ā BRANCH ON FIRST RESPONSE': {
|
|
328
325
|
action: 'replace',
|
|
329
326
|
body: AFTER_GREETING_BODY,
|
|
330
|
-
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).',
|
|
327
|
+
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.',
|
|
331
328
|
},
|
|
332
329
|
'Config Files': { action: 'keep', note: 'Kept verbatim ā shell facts, runtime-neutral.' },
|
|
333
330
|
'Knowledge Graph': { action: 'keep', note: 'Kept verbatim ā bin/graph.sh is runtime-neutral.' },
|
|
@@ -101,7 +101,12 @@ skill_description() {
|
|
|
101
101
|
in_fm && $0 == "---" { exit }
|
|
102
102
|
in_fm && /^description:/ {
|
|
103
103
|
sub(/^description:[[:space:]]*/, "")
|
|
104
|
-
|
|
104
|
+
# Block scalars (description: >) keep the text on continuation lines we
|
|
105
|
+
# do not read. Emit nothing so the caller falls back, which the skill-v1
|
|
106
|
+
# contract check reports, rather than publishing the indicator itself.
|
|
107
|
+
if ($0 ~ /^[>|][-+]?[[:space:]]*$/) { exit }
|
|
108
|
+
if ($0 ~ /^".*"$/) { gsub(/^"|"$/, "") }
|
|
109
|
+
else if ($0 ~ /^\047.*\047$/) { gsub(/^\047|\047$/, ""); gsub(/\047\047/, "\047") }
|
|
105
110
|
print
|
|
106
111
|
exit
|
|
107
112
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
set -u
|
|
3
|
+
|
|
4
|
+
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
5
|
+
CONFIG="$SCRIPT_DIR/egregore.json"
|
|
6
|
+
EXPECTED_REPO=""
|
|
7
|
+
|
|
8
|
+
usage() {
|
|
9
|
+
echo "usage: bash bin/contribute-guard.sh [--config <path>] [--expect <owner/repo>]" >&2
|
|
10
|
+
exit 2
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
fail() {
|
|
14
|
+
echo "contribute: $1" >&2
|
|
15
|
+
exit "${2:-2}"
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
while [ $# -gt 0 ]; do
|
|
19
|
+
case "$1" in
|
|
20
|
+
--config)
|
|
21
|
+
[ $# -ge 2 ] || usage
|
|
22
|
+
CONFIG="$2"
|
|
23
|
+
shift 2
|
|
24
|
+
;;
|
|
25
|
+
--expect)
|
|
26
|
+
[ $# -ge 2 ] || usage
|
|
27
|
+
EXPECTED_REPO="$2"
|
|
28
|
+
shift 2
|
|
29
|
+
;;
|
|
30
|
+
--help|-h)
|
|
31
|
+
usage
|
|
32
|
+
;;
|
|
33
|
+
*)
|
|
34
|
+
usage
|
|
35
|
+
;;
|
|
36
|
+
esac
|
|
37
|
+
done
|
|
38
|
+
|
|
39
|
+
[ -f "$CONFIG" ] || fail "cannot read configuration at $CONFIG; refusing to select an upstream target"
|
|
40
|
+
|
|
41
|
+
UPSTREAM_URL=$(jq -er '
|
|
42
|
+
if has("upstream_url") then
|
|
43
|
+
if .upstream_url == null then ""
|
|
44
|
+
elif (.upstream_url | type) == "string" then .upstream_url
|
|
45
|
+
else error("upstream_url must be a string")
|
|
46
|
+
end
|
|
47
|
+
else ""
|
|
48
|
+
end
|
|
49
|
+
' "$CONFIG" 2>/dev/null) ||
|
|
50
|
+
fail "configuration is invalid; refusing to select an upstream target"
|
|
51
|
+
|
|
52
|
+
if [ "$UPSTREAM_URL" = "none" ]; then
|
|
53
|
+
fail 'disabled because upstream_url is "none"; this checkout is a framework source, so use the save workflow for its configured integration branch' 3
|
|
54
|
+
fi
|
|
55
|
+
|
|
56
|
+
[ -n "$UPSTREAM_URL" ] || UPSTREAM_URL="https://github.com/egregore-labs/egregore.git"
|
|
57
|
+
|
|
58
|
+
case "$UPSTREAM_URL" in
|
|
59
|
+
https://github.com/*/*)
|
|
60
|
+
UPSTREAM_REPO="${UPSTREAM_URL#*github.com/}"
|
|
61
|
+
;;
|
|
62
|
+
git@github.com:*/*)
|
|
63
|
+
UPSTREAM_REPO="${UPSTREAM_URL#git@github.com:}"
|
|
64
|
+
;;
|
|
65
|
+
*)
|
|
66
|
+
fail "unsupported upstream_url '$UPSTREAM_URL'; expected a GitHub repository URL"
|
|
67
|
+
;;
|
|
68
|
+
esac
|
|
69
|
+
|
|
70
|
+
UPSTREAM_REPO="${UPSTREAM_REPO%/}"
|
|
71
|
+
UPSTREAM_REPO="${UPSTREAM_REPO%.git}"
|
|
72
|
+
printf '%s\n' "$UPSTREAM_REPO" | grep -Eq '^[A-Za-z0-9_.-]+/[A-Za-z0-9_.-]+$' ||
|
|
73
|
+
fail "invalid upstream repository '$UPSTREAM_REPO'; refusing external Git operations"
|
|
74
|
+
|
|
75
|
+
if [ -n "$EXPECTED_REPO" ] && [ "$EXPECTED_REPO" != "$UPSTREAM_REPO" ]; then
|
|
76
|
+
fail "target changed from '$EXPECTED_REPO' to '$UPSTREAM_REPO'; refusing external Git operations"
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
printf '%s\n' "$UPSTREAM_REPO"
|
|
@@ -77,7 +77,7 @@ if [ -d "$MEMORY_DIR" ]; then
|
|
|
77
77
|
(
|
|
78
78
|
cd "$MEMORY_DIR" || exit 0
|
|
79
79
|
git add -A >/dev/null 2>&1
|
|
80
|
-
git commit -m "
|
|
80
|
+
git commit -m "chore(handoff): backfill PR numbers for $TOPIC" >/dev/null 2>&1 || exit 0
|
|
81
81
|
git pull --rebase origin main --quiet >/dev/null 2>&1
|
|
82
82
|
git push origin main --quiet >/dev/null 2>&1
|
|
83
83
|
) || true
|
|
@@ -36,6 +36,11 @@ set -euo pipefail
|
|
|
36
36
|
# 1 on unrecoverable failure (file write, memory push, bad args).
|
|
37
37
|
|
|
38
38
|
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
39
|
+
# shellcheck source=bin/lib/git-message.sh
|
|
40
|
+
. "$SCRIPT_DIR/bin/lib/git-message.sh" 2>/dev/null || true
|
|
41
|
+
type egregore_commit >/dev/null 2>&1 || egregore_commit() {
|
|
42
|
+
local gd="$1" m="$3"; shift 3; git -C "$gd" commit -m "$m" "$@"
|
|
43
|
+
}
|
|
39
44
|
CONFIG="$SCRIPT_DIR/egregore.json"
|
|
40
45
|
|
|
41
46
|
if [[ "${1:-}" == "--help" || "${1:-}" == "-h" ]]; then
|
|
@@ -326,12 +331,12 @@ PID_ARTIFACTS=$!
|
|
|
326
331
|
git add "$REL_FILE" handoffs/index.md >/dev/null 2>&1
|
|
327
332
|
|
|
328
333
|
if [ -n "$RECIPIENT" ]; then
|
|
329
|
-
MSG_COMMIT="
|
|
334
|
+
MSG_COMMIT="chore(handoff): record ${TOPIC} (to ${RECIPIENT})"
|
|
330
335
|
else
|
|
331
|
-
MSG_COMMIT="
|
|
336
|
+
MSG_COMMIT="chore(handoff): record ${TOPIC}"
|
|
332
337
|
fi
|
|
333
338
|
|
|
334
|
-
|
|
339
|
+
egregore_commit . "$SCRIPT_DIR" "$MSG_COMMIT" >/dev/null 2>&1 || true
|
|
335
340
|
|
|
336
341
|
STASHED=0
|
|
337
342
|
if [ -n "$(git status --porcelain 2>/dev/null)" ]; then
|
|
@@ -47,19 +47,16 @@ done
|
|
|
47
47
|
|
|
48
48
|
case "$KIND" in
|
|
49
49
|
autosave)
|
|
50
|
-
MSG_PREFIX="
|
|
50
|
+
MSG_PREFIX="chore(autosave): save"
|
|
51
51
|
PR_WHAT="Save session content captured by the opted-in autosave workflow."
|
|
52
52
|
PR_WHY="This preserves unattended non-coding work without requiring an explicit /save."
|
|
53
53
|
;;
|
|
54
54
|
*)
|
|
55
|
-
MSG_PREFIX="
|
|
55
|
+
MSG_PREFIX="chore(handoff): record"
|
|
56
56
|
PR_WHAT="Save core-repository session work captured when the handoff was created."
|
|
57
57
|
PR_WHY="The handoff records shared context immediately; this companion PR keeps the originating checkout's work from remaining only local."
|
|
58
58
|
;;
|
|
59
59
|
esac
|
|
60
|
-
PR_BODY=$(printf '## What\n\n- %s\n\n## Why\n\n%s Topic: `%s`.\n\n## Verification\n\nNot verified ā background %s save; review code or configuration changes before merging.\n\nš¤ Saved via `bin/handoff-save-egregore.sh`\n' \
|
|
61
|
-
"$PR_WHAT" "$PR_WHY" "$TOPIC" "$KIND")
|
|
62
|
-
|
|
63
60
|
[ -n "$AUTHOR" ] || { echo "handoff-save-egregore: missing author" >&2; exit 1; }
|
|
64
61
|
|
|
65
62
|
SCRIPT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
|
|
@@ -88,6 +85,21 @@ BASE_REF="origin/$BASE_BRANCH"
|
|
|
88
85
|
. "$SCRIPT_DIR/bin/lib/git-safe.sh" 2>/dev/null || true
|
|
89
86
|
type git_add_guarded >/dev/null 2>&1 || git_add_guarded() { git add -A 2>/dev/null || true; }
|
|
90
87
|
|
|
88
|
+
# Shared commit/PR message mechanics (trailers + skeleton body shape).
|
|
89
|
+
# shellcheck source=bin/lib/git-message.sh
|
|
90
|
+
. "$SCRIPT_DIR/bin/lib/git-message.sh" 2>/dev/null || true
|
|
91
|
+
type egregore_commit >/dev/null 2>&1 || egregore_commit() {
|
|
92
|
+
local gd="$1" m="$3"; shift 3; git -C "$gd" commit -m "$m" "$@"
|
|
93
|
+
}
|
|
94
|
+
type egregore_pr_skeleton >/dev/null 2>&1 || egregore_pr_skeleton() {
|
|
95
|
+
printf '## What\n%s\n\n## Why\n%s\n\n## Verification\n%s\n\n%s\n' "$1" "$2" "$3" "$4"
|
|
96
|
+
}
|
|
97
|
+
PR_BODY=$(egregore_pr_skeleton \
|
|
98
|
+
"- $PR_WHAT" \
|
|
99
|
+
"$PR_WHY Topic: \`$TOPIC\`." \
|
|
100
|
+
"Not verified ā background $KIND save; review code or configuration changes before merging." \
|
|
101
|
+
"š¤ Saved via \`bin/handoff-save-egregore.sh\`")
|
|
102
|
+
|
|
91
103
|
# Shared non-coding classifier (auto-merge policy lives in one place).
|
|
92
104
|
# shellcheck source=bin/lib/noncode.sh
|
|
93
105
|
. "$SCRIPT_DIR/bin/lib/noncode.sh" 2>/dev/null || true
|
|
@@ -123,7 +135,7 @@ if [ -z "$CURRENT_BRANCH" ] || [ "$CURRENT_BRANCH" = "$BASE_BRANCH" ] \
|
|
|
123
135
|
# hash from the autosave sweep) ā same-name pushes wedge on non-FF.
|
|
124
136
|
NEW_BRANCH="dev/${AUTHOR}/${KIND}-${SLUG_DATE}${BRANCH_SUFFIX:+-$BRANCH_SUFFIX}"
|
|
125
137
|
git fetch origin "$BASE_BRANCH" --quiet 2>/dev/null || true
|
|
126
|
-
git checkout -b "$NEW_BRANCH" "$BASE_REF" --quiet 2>/dev/null || \
|
|
138
|
+
git checkout --no-track -b "$NEW_BRANCH" "$BASE_REF" --quiet 2>/dev/null || \
|
|
127
139
|
git checkout "$NEW_BRANCH" --quiet 2>/dev/null || exit 0
|
|
128
140
|
CURRENT_BRANCH="$NEW_BRANCH"
|
|
129
141
|
fi
|
|
@@ -131,7 +143,7 @@ fi
|
|
|
131
143
|
# --- Commit whatever is uncommitted --------------------------------------
|
|
132
144
|
if [ -n "$(git status --porcelain 2>/dev/null)" ]; then
|
|
133
145
|
git_add_guarded
|
|
134
|
-
|
|
146
|
+
egregore_commit . "$REPO_DIR" "${MSG_PREFIX} ${TOPIC}" --quiet 2>/dev/null || true
|
|
135
147
|
fi
|
|
136
148
|
|
|
137
149
|
# --- Rebase onto the configured base, fall back to merge on conflicts ----
|
|
@@ -182,7 +194,7 @@ else
|
|
|
182
194
|
PR_URL=$(gh pr create \
|
|
183
195
|
--base "$BASE_BRANCH" \
|
|
184
196
|
--head "$CURRENT_BRANCH" \
|
|
185
|
-
--title "${MSG_PREFIX}
|
|
197
|
+
--title "${MSG_PREFIX} ${TOPIC}" \
|
|
186
198
|
--body "$PR_BODY" \
|
|
187
199
|
2>/dev/null || echo "")
|
|
188
200
|
PR_NUMBER=$(echo "$PR_URL" | grep -oE '[0-9]+$' || echo "")
|