create-egregore 0.20.2 → 0.21.0-runtime-mvp.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 +1013 -16
- package/bin/cli.js +11 -0
- package/lib/claude-runtime.js +192 -0
- package/lib/local.js +38 -31
- package/lib/pi-runtime.js +1 -0
- package/lib/prime-runtime.js +1 -0
- package/lib/runtime-identity.js +146 -0
- package/lib/setup.js +116 -17
- package/package.json +10 -6
- package/runtime/claude/.claude/context/commit-format.md +110 -0
- package/runtime/claude/.claude/context/git-language.md +46 -0
- package/runtime/claude/.claude/context/notification-consent.md +66 -0
- package/runtime/claude/.claude/context/pr-format.md +67 -0
- package/runtime/claude/.claude/context/telemetry.md +133 -0
- package/runtime/claude/.claude/hooks/boundary-check.sh +333 -0
- package/runtime/claude/.claude/hooks/branch-guard.sh +231 -0
- package/runtime/claude/.claude/hooks/card-context.sh +38 -0
- package/runtime/claude/.claude/hooks/emissary-detect.sh +53 -0
- package/runtime/claude/.claude/hooks/memory-refresh.sh +67 -0
- package/runtime/claude/.claude/hooks/onboarding-guard.sh +86 -0
- package/runtime/claude/.claude/hooks/retrieval-context.sh +43 -0
- package/runtime/claude/.claude/rules/voice-bedrock.md +73 -0
- package/runtime/claude/.claude/settings.json +131 -0
- package/runtime/claude/.claude/skills/activity/SKILL.md +68 -0
- package/runtime/claude/.claude/skills/announce/SKILL.md +54 -0
- package/runtime/claude/.claude/skills/archive/SKILL.md +71 -0
- package/runtime/claude/.claude/skills/branch/SKILL.md +147 -0
- package/runtime/claude/.claude/skills/checkup/SKILL.md +159 -0
- package/runtime/claude/.claude/skills/commit/SKILL.md +103 -0
- package/runtime/claude/.claude/skills/contribute/SKILL.md +343 -0
- package/runtime/claude/.claude/skills/create-skill/SKILL.md +135 -0
- package/runtime/claude/.claude/skills/dark-mode/SKILL.md +410 -0
- package/runtime/claude/.claude/skills/dashboard/SKILL.md +43 -0
- package/runtime/claude/.claude/skills/deep-reflect/REPORT.md +140 -0
- package/runtime/claude/.claude/skills/deep-reflect/RESEARCH.md +132 -0
- package/runtime/claude/.claude/skills/deep-reflect/ROLES.md +104 -0
- package/runtime/claude/.claude/skills/deep-reflect/SKILL.md +170 -0
- package/runtime/claude/.claude/skills/delete-user/SKILL.md +150 -0
- package/runtime/claude/.claude/skills/emissary/SKILL.md +220 -0
- package/runtime/claude/.claude/skills/handoff/SKILL.md +124 -0
- package/runtime/claude/.claude/skills/harvest/AUDIT.md +546 -0
- package/runtime/claude/.claude/skills/harvest/FORMAT.md +436 -0
- package/runtime/claude/.claude/skills/harvest/PROCESS.md +395 -0
- package/runtime/claude/.claude/skills/harvest/QUESTION_PALETTE.md +76 -0
- package/runtime/claude/.claude/skills/harvest/SKILL.md +100 -0
- package/runtime/claude/.claude/skills/ingest/SKILL.md +112 -0
- package/runtime/claude/.claude/skills/ingest-corpus/SKILL.md +187 -0
- package/runtime/claude/.claude/skills/ingest-notion/SKILL.md +214 -0
- package/runtime/claude/.claude/skills/ingest-user-interview/SKILL.md +65 -0
- package/runtime/claude/.claude/skills/ingest-user-interview/references/analysis-contract.md +125 -0
- package/runtime/claude/.claude/skills/invite/SKILL.md +111 -0
- package/runtime/claude/.claude/skills/issue/SKILL.md +104 -0
- package/runtime/claude/.claude/skills/me/SKILL.md +81 -0
- package/runtime/claude/.claude/skills/meeting/SKILL.md +76 -0
- package/runtime/claude/.claude/skills/meeting/references/analysis-contract.md +102 -0
- package/runtime/claude/.claude/skills/note/SKILL.md +71 -0
- package/runtime/claude/.claude/skills/notion-connect/SKILL.md +124 -0
- package/runtime/claude/.claude/skills/onboarding/SKILL.md +159 -0
- package/runtime/claude/.claude/skills/pr/SKILL.md +85 -0
- package/runtime/claude/.claude/skills/pull/SKILL.md +79 -0
- package/runtime/claude/.claude/skills/push/SKILL.md +47 -0
- package/runtime/claude/.claude/skills/quest/SKILL.md +121 -0
- package/runtime/claude/.claude/skills/reflect/SKILL.md +69 -0
- package/runtime/claude/.claude/skills/review-pr/SKILL.md +276 -0
- package/runtime/claude/.claude/skills/save/SKILL.md +92 -0
- package/runtime/claude/.claude/skills/slack-connect/SKILL.md +148 -0
- package/runtime/claude/.claude/skills/summon/SKILL.md +240 -0
- package/runtime/claude/.claude/skills/sync-repos/SKILL.md +82 -0
- package/runtime/claude/.claude/skills/teams-connect/SKILL.md +216 -0
- package/runtime/claude/.claude/skills/telegram-connect/SKILL.md +110 -0
- package/runtime/claude/.claude/skills/telemetry/SKILL.md +117 -0
- package/runtime/claude/.claude/skills/test/SKILL.md +87 -0
- package/runtime/claude/.claude/skills/the-spiral/SKILL.md +492 -0
- package/runtime/claude/.claude/skills/tui-design/SKILL.md +188 -0
- package/runtime/claude/.claude/skills/tutorial/SKILL.md +100 -0
- package/runtime/claude/.claude/skills/update/SKILL.md +265 -0
- package/runtime/claude/.claude/skills/view/SKILL.md +393 -0
- package/runtime/claude/.claude/skills/view/compose-scaffold.html +221 -0
- package/runtime/claude/.claude/skills/visual-explain/SKILL.md +132 -0
- package/runtime/claude/.claude/skills/wrap/SKILL.md +98 -0
- package/runtime/claude/CLAUDE.md +447 -0
- package/runtime/claude/bin/activity-action.sh +92 -0
- package/runtime/claude/bin/activity-data.sh +17 -0
- package/runtime/claude/bin/agent.sh +783 -0
- package/runtime/claude/bin/artifact-register.sh +164 -0
- package/runtime/claude/bin/artifact-writeback.sh +53 -0
- package/runtime/claude/bin/artifacts.sh +288 -0
- package/runtime/claude/bin/attendant.sh +707 -0
- package/runtime/claude/bin/autosave.sh +112 -0
- package/runtime/claude/bin/boundary.sh +253 -0
- package/runtime/claude/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/claude/bin/capture-reconcile.sh +69 -0
- package/runtime/claude/bin/capture-run.sh +357 -0
- package/runtime/claude/bin/codex-install-skills.sh +78 -0
- package/runtime/claude/bin/codex-render-spec.mjs +462 -0
- package/runtime/claude/bin/codex-session-start.sh +275 -0
- package/runtime/claude/bin/codex-skill-render.mjs +349 -0
- package/runtime/claude/bin/codex-sync-skills.sh +237 -0
- package/runtime/claude/bin/connect-refresh.sh +33 -0
- package/runtime/claude/bin/contribute-guard.sh +79 -0
- package/runtime/claude/bin/corpus_map.py +806 -0
- package/runtime/claude/bin/corpus_survey.py +304 -0
- package/runtime/claude/bin/dashboard-data.sh +18 -0
- package/runtime/claude/bin/github-auth.sh +121 -0
- package/runtime/claude/bin/graph-batch.sh +86 -0
- package/runtime/claude/bin/graph-op.sh +1106 -0
- package/runtime/claude/bin/graph-projection.sh +54 -0
- package/runtime/claude/bin/graph-wal.sh +242 -0
- package/runtime/claude/bin/graph.sh +267 -0
- package/runtime/claude/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/claude/bin/handoff-lifecycle.sh +280 -0
- package/runtime/claude/bin/handoff-pr-backfill.sh +86 -0
- package/runtime/claude/bin/handoff-preview.sh +169 -0
- package/runtime/claude/bin/handoff-run.sh +692 -0
- package/runtime/claude/bin/handoff-save-egregore.sh +224 -0
- package/runtime/claude/bin/index-handoff.sh +322 -0
- package/runtime/claude/bin/ingest-graph.sh +86 -0
- package/runtime/claude/bin/ingest-item.sh +10 -0
- package/runtime/claude/bin/ingest-surface.html +495 -0
- package/runtime/claude/bin/ingest.py +1011 -0
- package/runtime/claude/bin/ingest.sh +308 -0
- package/runtime/claude/bin/ingest_graph.py +856 -0
- package/runtime/claude/bin/ingest_surface.py +544 -0
- package/runtime/claude/bin/invite.sh +6 -0
- package/runtime/claude/bin/issue.sh +10 -0
- package/runtime/claude/bin/knowledge.sh +10 -0
- package/runtime/claude/bin/lib/artifact-id.sh +46 -0
- package/runtime/claude/bin/lib/config.sh +136 -0
- package/runtime/claude/bin/lib/context.sh +642 -0
- package/runtime/claude/bin/lib/dashboard-artifact.sh +242 -0
- package/runtime/claude/bin/lib/ensure-develop.sh +183 -0
- package/runtime/claude/bin/lib/git-message.sh +37 -0
- package/runtime/claude/bin/lib/git-sync.sh +494 -0
- package/runtime/claude/bin/lib/greeting.sh +548 -0
- package/runtime/claude/bin/lib/handoff-meta.sh +97 -0
- package/runtime/claude/bin/lib/hash.sh +13 -0
- package/runtime/claude/bin/lib/identity.sh +213 -0
- package/runtime/claude/bin/lib/metrics.sh +374 -0
- package/runtime/claude/bin/lib/noncode.sh +31 -0
- package/runtime/claude/bin/lib/permissions.sh +106 -0
- package/runtime/claude/bin/lib/time.sh +56 -0
- package/runtime/claude/bin/lib/worktree-links.sh +85 -0
- package/runtime/claude/bin/node-run.sh +42 -0
- package/runtime/claude/bin/notification.sh +6 -0
- package/runtime/claude/bin/notify.sh +636 -0
- package/runtime/claude/bin/observe-context.sh +14 -0
- package/runtime/claude/bin/onboarding.sh +6 -0
- package/runtime/claude/bin/person.py +634 -0
- package/runtime/claude/bin/person.sh +481 -0
- package/runtime/claude/bin/pi-render-spec.mjs +140 -0
- package/runtime/claude/bin/post-update.sh +37 -0
- package/runtime/claude/bin/prime-render-spec.mjs +147 -0
- package/runtime/claude/bin/publish-artifact.sh +324 -0
- package/runtime/claude/bin/publish-references.sh +144 -0
- package/runtime/claude/bin/quest.sh +9 -0
- package/runtime/claude/bin/question.sh +8 -0
- package/runtime/claude/bin/repo-state.sh +96 -0
- package/runtime/claude/bin/research-ingest.sh +7 -0
- package/runtime/claude/bin/restore-owned-skills.sh +67 -0
- package/runtime/claude/bin/retrieval_eval.py +385 -0
- package/runtime/claude/bin/runtime-identity.sh +70 -0
- package/runtime/claude/bin/runtime-upgrade.sh +43 -0
- package/runtime/claude/bin/scroll.sh +9 -0
- package/runtime/claude/bin/search.sh +318 -0
- package/runtime/claude/bin/session-autosave.sh +220 -0
- package/runtime/claude/bin/session-log.sh +199 -0
- package/runtime/claude/bin/session-start.sh +696 -0
- package/runtime/claude/bin/settings.sh +532 -0
- package/runtime/claude/bin/startup-check.sh +136 -0
- package/runtime/claude/bin/statusline.sh +41 -0
- package/runtime/claude/bin/telemetry.sh +666 -0
- package/runtime/claude/bin/test-changes.sh +344 -0
- package/runtime/claude/bin/thread.sh +9 -0
- package/runtime/claude/bin/todo.sh +9 -0
- package/runtime/claude/bin/view-render.sh +126 -0
- package/runtime/claude/bin/worktree-create.sh +145 -0
- package/runtime/claude/bin/worktree-remove.sh +50 -0
- package/runtime/claude/bin/worktree.sh +198 -0
- package/runtime/claude/egregore_runtime/__init__.py +228 -0
- package/runtime/claude/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/claude/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/claude/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/claude/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/claude/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/claude/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/claude/egregore_runtime/admin_gate.py +102 -0
- package/runtime/claude/egregore_runtime/artifacts.py +523 -0
- package/runtime/claude/egregore_runtime/contracts.py +499 -0
- package/runtime/claude/egregore_runtime/entitlements.py +85 -0
- package/runtime/claude/egregore_runtime/errors.py +10 -0
- package/runtime/claude/egregore_runtime/graph.py +356 -0
- package/runtime/claude/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/claude/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/claude/egregore_runtime/identity.py +734 -0
- package/runtime/claude/egregore_runtime/identity_cli.py +91 -0
- package/runtime/claude/egregore_runtime/ingest.py +575 -0
- package/runtime/claude/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/claude/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/claude/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/claude/egregore_runtime/invitations.py +116 -0
- package/runtime/claude/egregore_runtime/issue_cli.py +305 -0
- package/runtime/claude/egregore_runtime/issues.py +359 -0
- package/runtime/claude/egregore_runtime/knowledge.py +376 -0
- package/runtime/claude/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/claude/egregore_runtime/lifecycle.py +888 -0
- package/runtime/claude/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/claude/egregore_runtime/notification_cli.py +125 -0
- package/runtime/claude/egregore_runtime/notifications.py +230 -0
- package/runtime/claude/egregore_runtime/observe.py +342 -0
- package/runtime/claude/egregore_runtime/onboarding.py +290 -0
- package/runtime/claude/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/claude/egregore_runtime/policy.py +144 -0
- package/runtime/claude/egregore_runtime/profile.py +193 -0
- package/runtime/claude/egregore_runtime/quest_cli.py +216 -0
- package/runtime/claude/egregore_runtime/question_cli.py +180 -0
- package/runtime/claude/egregore_runtime/questions.py +304 -0
- package/runtime/claude/egregore_runtime/quests.py +419 -0
- package/runtime/claude/egregore_runtime/readiness.py +379 -0
- package/runtime/claude/egregore_runtime/research_ingest.py +256 -0
- package/runtime/claude/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/claude/egregore_runtime/runtime.py +464 -0
- package/runtime/claude/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/claude/egregore_runtime/scrolls.py +726 -0
- package/runtime/claude/egregore_runtime/status.py +412 -0
- package/runtime/claude/egregore_runtime/status_cli.py +174 -0
- package/runtime/claude/egregore_runtime/sync.py +218 -0
- package/runtime/claude/egregore_runtime/teamsync.py +139 -0
- package/runtime/claude/egregore_runtime/telemetry.py +640 -0
- package/runtime/claude/egregore_runtime/thread_cli.py +173 -0
- package/runtime/claude/egregore_runtime/threads.py +517 -0
- package/runtime/claude/egregore_runtime/todo_cli.py +142 -0
- package/runtime/claude/egregore_runtime/todos.py +244 -0
- package/runtime/claude/egregore_runtime/upgrade.py +770 -0
- package/runtime/claude/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/claude/egregore_runtime/writeback.py +391 -0
- package/runtime/claude/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/claude/manifest.json +284 -0
- package/runtime/codex/.codex/hooks/search-hint.js +21 -52
- package/runtime/codex/.codex/hooks.json +3 -3
- package/runtime/codex/.codex/skills/activity/SKILL.md +23 -66
- package/runtime/codex/.codex/skills/announce/SKILL.md +27 -50
- package/runtime/codex/.codex/skills/archive/SKILL.md +21 -36
- package/runtime/codex/.codex/skills/checkup/SKILL.md +77 -36
- package/runtime/codex/.codex/skills/dark-mode/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/dashboard/SKILL.md +17 -47
- package/runtime/codex/.codex/skills/handoff/SKILL.md +84 -133
- package/runtime/codex/.codex/skills/harvest/SKILL.md +32 -117
- package/runtime/codex/.codex/skills/ingest/SKILL.md +47 -25
- package/runtime/codex/.codex/skills/ingest-user-interview/SKILL.md +18 -36
- package/runtime/codex/.codex/skills/ingest-user-interview/references/analysis-contract.md +42 -0
- package/runtime/codex/.codex/skills/invite/SKILL.md +21 -35
- package/runtime/codex/.codex/skills/issue/SKILL.md +60 -41
- package/runtime/codex/.codex/skills/me/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/meeting/SKILL.md +16 -36
- package/runtime/codex/.codex/skills/meeting/references/analysis-contract.md +48 -0
- package/runtime/codex/.codex/skills/note/SKILL.md +30 -25
- package/runtime/codex/.codex/skills/onboarding/SKILL.md +36 -41
- package/runtime/codex/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/codex/.codex/skills/quest/SKILL.md +27 -66
- package/runtime/codex/.codex/skills/reflect/SKILL.md +22 -36
- package/runtime/codex/.codex/skills/save/SKILL.md +2 -2
- 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 +40 -41
- package/runtime/codex/.codex/skills/view/SKILL.md +115 -111
- package/runtime/codex/.codex/skills/wrap/SKILL.md +45 -41
- package/runtime/codex/.codex/spec-manifest.json +9 -9
- package/runtime/codex/AGENTS.md +62 -58
- package/runtime/codex/bin/activity-action.sh +92 -0
- package/runtime/codex/bin/activity-data.sh +12 -233
- package/runtime/codex/bin/agent.sh +84 -100
- package/runtime/codex/bin/artifact-register.sh +164 -0
- package/runtime/codex/bin/artifact-writeback.sh +53 -0
- package/runtime/codex/bin/artifacts.sh +288 -0
- package/runtime/codex/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/codex/bin/capture-run.sh +18 -2
- package/runtime/codex/bin/codex-render-spec.mjs +41 -16
- package/runtime/codex/bin/codex-session-start.sh +14 -4
- package/runtime/codex/bin/codex-skill-render.mjs +9 -7
- package/runtime/codex/bin/corpus_map.py +806 -0
- package/runtime/codex/bin/corpus_survey.py +304 -0
- package/runtime/codex/bin/dashboard-data.sh +11 -171
- package/runtime/codex/bin/github-auth.sh +121 -0
- package/runtime/codex/bin/graph-batch.sh +7 -0
- package/runtime/codex/bin/graph-op.sh +4 -0
- package/runtime/codex/bin/graph-projection.sh +54 -0
- package/runtime/codex/bin/graph-wal.sh +13 -0
- package/runtime/codex/bin/graph.sh +44 -0
- package/runtime/codex/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/codex/bin/handoff-lifecycle.sh +280 -0
- package/runtime/codex/bin/handoff-preview.sh +169 -0
- package/runtime/codex/bin/handoff-run.sh +42 -26
- package/runtime/codex/bin/ingest-graph.sh +6 -0
- package/runtime/codex/bin/ingest-item.sh +10 -0
- package/runtime/codex/bin/ingest.sh +59 -30
- package/runtime/codex/bin/invite.sh +6 -0
- package/runtime/codex/bin/issue.sh +10 -0
- package/runtime/codex/bin/knowledge.sh +10 -0
- package/runtime/codex/bin/lib/config.sh +20 -0
- package/runtime/codex/bin/lib/context.sh +46 -25
- package/runtime/codex/bin/lib/git-sync.sh +70 -6
- package/runtime/codex/bin/lib/greeting.sh +34 -5
- package/runtime/codex/bin/lib/handoff-meta.sh +97 -0
- package/runtime/codex/bin/lib/worktree-links.sh +6 -0
- package/runtime/codex/bin/node-run.sh +42 -0
- package/runtime/codex/bin/notification.sh +6 -0
- package/runtime/codex/bin/observe-context.sh +14 -0
- package/runtime/codex/bin/onboarding.sh +6 -0
- package/runtime/codex/bin/person.py +4 -0
- package/runtime/codex/bin/person.sh +43 -10
- package/runtime/codex/bin/pi-render-spec.mjs +140 -0
- package/runtime/codex/bin/post-update.sh +37 -0
- package/runtime/codex/bin/prime-render-spec.mjs +147 -0
- package/runtime/codex/bin/publish-artifact.sh +55 -2
- package/runtime/codex/bin/quest.sh +9 -0
- package/runtime/codex/bin/question.sh +8 -0
- package/runtime/codex/bin/research-ingest.sh +7 -0
- package/runtime/codex/bin/restore-owned-skills.sh +67 -0
- package/runtime/codex/bin/retrieval_eval.py +385 -0
- package/runtime/codex/bin/runtime-identity.sh +70 -0
- package/runtime/codex/bin/runtime-upgrade.sh +43 -0
- package/runtime/codex/bin/scroll.sh +9 -0
- package/runtime/codex/bin/search.sh +231 -195
- package/runtime/codex/bin/settings.sh +174 -5
- package/runtime/codex/bin/startup-check.sh +136 -0
- package/runtime/codex/bin/telemetry.sh +522 -247
- package/runtime/codex/bin/test-changes.sh +344 -0
- package/runtime/codex/bin/thread.sh +9 -0
- package/runtime/codex/bin/todo.sh +9 -0
- package/runtime/codex/bin/view-render.sh +126 -0
- package/runtime/codex/bin/worktree-create.sh +19 -5
- package/runtime/codex/egregore_runtime/__init__.py +228 -0
- package/runtime/codex/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/codex/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/codex/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/codex/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/codex/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/codex/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/codex/egregore_runtime/admin_gate.py +102 -0
- package/runtime/codex/egregore_runtime/artifacts.py +523 -0
- package/runtime/codex/egregore_runtime/contracts.py +499 -0
- package/runtime/codex/egregore_runtime/entitlements.py +85 -0
- package/runtime/codex/egregore_runtime/errors.py +10 -0
- package/runtime/codex/egregore_runtime/graph.py +356 -0
- package/runtime/codex/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/codex/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/codex/egregore_runtime/identity.py +734 -0
- package/runtime/codex/egregore_runtime/identity_cli.py +91 -0
- package/runtime/codex/egregore_runtime/ingest.py +575 -0
- package/runtime/codex/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/codex/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/codex/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/codex/egregore_runtime/invitations.py +116 -0
- package/runtime/codex/egregore_runtime/issue_cli.py +305 -0
- package/runtime/codex/egregore_runtime/issues.py +359 -0
- package/runtime/codex/egregore_runtime/knowledge.py +376 -0
- package/runtime/codex/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/codex/egregore_runtime/lifecycle.py +888 -0
- package/runtime/codex/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/codex/egregore_runtime/notification_cli.py +125 -0
- package/runtime/codex/egregore_runtime/notifications.py +230 -0
- package/runtime/codex/egregore_runtime/observe.py +342 -0
- package/runtime/codex/egregore_runtime/onboarding.py +290 -0
- package/runtime/codex/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/codex/egregore_runtime/policy.py +144 -0
- package/runtime/codex/egregore_runtime/profile.py +193 -0
- package/runtime/codex/egregore_runtime/quest_cli.py +216 -0
- package/runtime/codex/egregore_runtime/question_cli.py +180 -0
- package/runtime/codex/egregore_runtime/questions.py +304 -0
- package/runtime/codex/egregore_runtime/quests.py +419 -0
- package/runtime/codex/egregore_runtime/readiness.py +379 -0
- package/runtime/codex/egregore_runtime/research_ingest.py +256 -0
- package/runtime/codex/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/codex/egregore_runtime/runtime.py +464 -0
- package/runtime/codex/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/codex/egregore_runtime/scrolls.py +726 -0
- package/runtime/codex/egregore_runtime/status.py +412 -0
- package/runtime/codex/egregore_runtime/status_cli.py +174 -0
- package/runtime/codex/egregore_runtime/sync.py +218 -0
- package/runtime/codex/egregore_runtime/teamsync.py +139 -0
- package/runtime/codex/egregore_runtime/telemetry.py +640 -0
- package/runtime/codex/egregore_runtime/thread_cli.py +173 -0
- package/runtime/codex/egregore_runtime/threads.py +517 -0
- package/runtime/codex/egregore_runtime/todo_cli.py +142 -0
- package/runtime/codex/egregore_runtime/todos.py +244 -0
- package/runtime/codex/egregore_runtime/upgrade.py +770 -0
- package/runtime/codex/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/codex/egregore_runtime/writeback.py +391 -0
- package/runtime/codex/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/codex/manifest.json +98 -1
- package/runtime/pi/.codex/hooks/search-hint.js +21 -52
- package/runtime/pi/.codex/hooks.json +3 -3
- package/runtime/pi/.codex/skills/activity/SKILL.md +23 -66
- package/runtime/pi/.codex/skills/announce/SKILL.md +27 -50
- package/runtime/pi/.codex/skills/archive/SKILL.md +21 -36
- package/runtime/pi/.codex/skills/checkup/SKILL.md +77 -36
- package/runtime/pi/.codex/skills/dark-mode/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/dashboard/SKILL.md +17 -47
- package/runtime/pi/.codex/skills/handoff/SKILL.md +84 -133
- package/runtime/pi/.codex/skills/harvest/SKILL.md +32 -117
- package/runtime/pi/.codex/skills/ingest/SKILL.md +47 -25
- package/runtime/pi/.codex/skills/ingest-user-interview/SKILL.md +18 -36
- package/runtime/pi/.codex/skills/ingest-user-interview/references/analysis-contract.md +42 -0
- package/runtime/pi/.codex/skills/invite/SKILL.md +21 -35
- package/runtime/pi/.codex/skills/issue/SKILL.md +60 -41
- package/runtime/pi/.codex/skills/me/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/meeting/SKILL.md +16 -36
- package/runtime/pi/.codex/skills/meeting/references/analysis-contract.md +48 -0
- package/runtime/pi/.codex/skills/note/SKILL.md +30 -25
- package/runtime/pi/.codex/skills/onboarding/SKILL.md +36 -41
- package/runtime/pi/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/pi/.codex/skills/quest/SKILL.md +27 -66
- package/runtime/pi/.codex/skills/reflect/SKILL.md +22 -36
- package/runtime/pi/.codex/skills/save/SKILL.md +2 -2
- 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 +40 -41
- package/runtime/pi/.codex/skills/view/SKILL.md +115 -111
- package/runtime/pi/.codex/skills/wrap/SKILL.md +45 -41
- package/runtime/pi/.codex/spec-manifest.json +9 -9
- package/runtime/pi/.pi/APPEND_SYSTEM.md +57 -48
- package/runtime/pi/.pi/extensions/egregore.ts +7 -0
- package/runtime/pi/.pi/spec-manifest.json +2 -2
- package/runtime/pi/AGENTS.md +62 -58
- package/runtime/pi/bin/activity-action.sh +92 -0
- package/runtime/pi/bin/activity-data.sh +12 -233
- package/runtime/pi/bin/agent.sh +84 -100
- package/runtime/pi/bin/artifact-register.sh +164 -0
- package/runtime/pi/bin/artifact-writeback.sh +53 -0
- package/runtime/pi/bin/artifacts.sh +288 -0
- package/runtime/pi/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/pi/bin/capture-run.sh +18 -2
- package/runtime/pi/bin/codex-render-spec.mjs +41 -16
- package/runtime/pi/bin/codex-session-start.sh +14 -4
- package/runtime/pi/bin/codex-skill-render.mjs +9 -7
- package/runtime/pi/bin/corpus_map.py +806 -0
- package/runtime/pi/bin/corpus_survey.py +304 -0
- package/runtime/pi/bin/dashboard-data.sh +11 -171
- package/runtime/pi/bin/github-auth.sh +121 -0
- package/runtime/pi/bin/graph-batch.sh +7 -0
- package/runtime/pi/bin/graph-op.sh +4 -0
- package/runtime/pi/bin/graph-projection.sh +54 -0
- package/runtime/pi/bin/graph-wal.sh +13 -0
- package/runtime/pi/bin/graph.sh +44 -0
- package/runtime/pi/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/pi/bin/handoff-lifecycle.sh +280 -0
- package/runtime/pi/bin/handoff-preview.sh +169 -0
- package/runtime/pi/bin/handoff-run.sh +42 -26
- package/runtime/pi/bin/ingest-graph.sh +6 -0
- package/runtime/pi/bin/ingest-item.sh +10 -0
- package/runtime/pi/bin/ingest.sh +59 -30
- package/runtime/pi/bin/invite.sh +6 -0
- package/runtime/pi/bin/issue.sh +10 -0
- package/runtime/pi/bin/knowledge.sh +10 -0
- package/runtime/pi/bin/lib/config.sh +20 -0
- package/runtime/pi/bin/lib/context.sh +46 -25
- package/runtime/pi/bin/lib/git-sync.sh +70 -6
- package/runtime/pi/bin/lib/greeting.sh +34 -5
- package/runtime/pi/bin/lib/handoff-meta.sh +97 -0
- package/runtime/pi/bin/lib/worktree-links.sh +6 -0
- package/runtime/pi/bin/node-run.sh +42 -0
- package/runtime/pi/bin/notification.sh +6 -0
- package/runtime/pi/bin/observe-context.sh +14 -0
- package/runtime/pi/bin/onboarding.sh +6 -0
- package/runtime/pi/bin/person.py +4 -0
- package/runtime/pi/bin/person.sh +43 -10
- package/runtime/pi/bin/pi-observe-context.mjs +93 -0
- package/runtime/pi/bin/pi-product-workflows.mjs +1 -1
- package/runtime/pi/bin/pi-render-spec.mjs +1 -1
- package/runtime/pi/bin/post-update.sh +37 -0
- package/runtime/pi/bin/prime-render-spec.mjs +147 -0
- package/runtime/pi/bin/publish-artifact.sh +55 -2
- package/runtime/pi/bin/quest.sh +9 -0
- package/runtime/pi/bin/question.sh +8 -0
- package/runtime/pi/bin/research-ingest.sh +7 -0
- package/runtime/pi/bin/restore-owned-skills.sh +67 -0
- package/runtime/pi/bin/retrieval_eval.py +385 -0
- package/runtime/pi/bin/runtime-identity.sh +70 -0
- package/runtime/pi/bin/runtime-upgrade.sh +43 -0
- package/runtime/pi/bin/scroll.sh +9 -0
- package/runtime/pi/bin/search.sh +231 -195
- package/runtime/pi/bin/settings.sh +174 -5
- package/runtime/pi/bin/startup-check.sh +136 -0
- package/runtime/pi/bin/telemetry.sh +522 -247
- package/runtime/pi/bin/test-changes.sh +344 -0
- package/runtime/pi/bin/thread.sh +9 -0
- package/runtime/pi/bin/todo.sh +9 -0
- package/runtime/pi/bin/view-render.sh +126 -0
- package/runtime/pi/bin/worktree-create.sh +19 -5
- package/runtime/pi/egregore_runtime/__init__.py +228 -0
- package/runtime/pi/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/pi/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/pi/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/pi/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/pi/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/pi/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/pi/egregore_runtime/admin_gate.py +102 -0
- package/runtime/pi/egregore_runtime/artifacts.py +523 -0
- package/runtime/pi/egregore_runtime/contracts.py +499 -0
- package/runtime/pi/egregore_runtime/entitlements.py +85 -0
- package/runtime/pi/egregore_runtime/errors.py +10 -0
- package/runtime/pi/egregore_runtime/graph.py +356 -0
- package/runtime/pi/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/pi/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/pi/egregore_runtime/identity.py +734 -0
- package/runtime/pi/egregore_runtime/identity_cli.py +91 -0
- package/runtime/pi/egregore_runtime/ingest.py +575 -0
- package/runtime/pi/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/pi/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/pi/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/pi/egregore_runtime/invitations.py +116 -0
- package/runtime/pi/egregore_runtime/issue_cli.py +305 -0
- package/runtime/pi/egregore_runtime/issues.py +359 -0
- package/runtime/pi/egregore_runtime/knowledge.py +376 -0
- package/runtime/pi/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/pi/egregore_runtime/lifecycle.py +888 -0
- package/runtime/pi/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/pi/egregore_runtime/notification_cli.py +125 -0
- package/runtime/pi/egregore_runtime/notifications.py +230 -0
- package/runtime/pi/egregore_runtime/observe.py +342 -0
- package/runtime/pi/egregore_runtime/onboarding.py +290 -0
- package/runtime/pi/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/pi/egregore_runtime/policy.py +144 -0
- package/runtime/pi/egregore_runtime/profile.py +193 -0
- package/runtime/pi/egregore_runtime/quest_cli.py +216 -0
- package/runtime/pi/egregore_runtime/question_cli.py +180 -0
- package/runtime/pi/egregore_runtime/questions.py +304 -0
- package/runtime/pi/egregore_runtime/quests.py +419 -0
- package/runtime/pi/egregore_runtime/readiness.py +379 -0
- package/runtime/pi/egregore_runtime/research_ingest.py +256 -0
- package/runtime/pi/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/pi/egregore_runtime/runtime.py +464 -0
- package/runtime/pi/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/pi/egregore_runtime/scrolls.py +726 -0
- package/runtime/pi/egregore_runtime/status.py +412 -0
- package/runtime/pi/egregore_runtime/status_cli.py +174 -0
- package/runtime/pi/egregore_runtime/sync.py +218 -0
- package/runtime/pi/egregore_runtime/teamsync.py +139 -0
- package/runtime/pi/egregore_runtime/telemetry.py +640 -0
- package/runtime/pi/egregore_runtime/thread_cli.py +173 -0
- package/runtime/pi/egregore_runtime/threads.py +517 -0
- package/runtime/pi/egregore_runtime/todo_cli.py +142 -0
- package/runtime/pi/egregore_runtime/todos.py +244 -0
- package/runtime/pi/egregore_runtime/upgrade.py +770 -0
- package/runtime/pi/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/pi/egregore_runtime/writeback.py +391 -0
- package/runtime/pi/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/pi/manifest.json +98 -1
- package/runtime/prime/.codex/hooks/search-hint.js +21 -52
- package/runtime/prime/.codex/hooks.json +3 -3
- package/runtime/prime/.codex/skills/activity/SKILL.md +23 -66
- package/runtime/prime/.codex/skills/announce/SKILL.md +27 -50
- package/runtime/prime/.codex/skills/archive/SKILL.md +21 -36
- package/runtime/prime/.codex/skills/checkup/SKILL.md +77 -36
- package/runtime/prime/.codex/skills/dark-mode/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/dashboard/SKILL.md +17 -47
- package/runtime/prime/.codex/skills/handoff/SKILL.md +84 -133
- package/runtime/prime/.codex/skills/harvest/SKILL.md +32 -117
- package/runtime/prime/.codex/skills/ingest/SKILL.md +47 -25
- package/runtime/prime/.codex/skills/ingest-user-interview/SKILL.md +18 -36
- package/runtime/prime/.codex/skills/ingest-user-interview/references/analysis-contract.md +42 -0
- package/runtime/prime/.codex/skills/invite/SKILL.md +21 -35
- package/runtime/prime/.codex/skills/issue/SKILL.md +60 -41
- package/runtime/prime/.codex/skills/me/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/meeting/SKILL.md +16 -36
- package/runtime/prime/.codex/skills/meeting/references/analysis-contract.md +48 -0
- package/runtime/prime/.codex/skills/note/SKILL.md +30 -25
- package/runtime/prime/.codex/skills/onboarding/SKILL.md +36 -41
- package/runtime/prime/.codex/skills/pull/SKILL.md +1 -1
- package/runtime/prime/.codex/skills/quest/SKILL.md +27 -66
- package/runtime/prime/.codex/skills/reflect/SKILL.md +22 -36
- package/runtime/prime/.codex/skills/save/SKILL.md +2 -2
- 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 +40 -41
- package/runtime/prime/.codex/skills/view/SKILL.md +115 -111
- package/runtime/prime/.codex/skills/wrap/SKILL.md +45 -41
- package/runtime/prime/.codex/spec-manifest.json +9 -9
- package/runtime/prime/.prime/agent/APPEND_SYSTEM.md +57 -48
- package/runtime/prime/.prime/agent/extensions/egregore.ts +7 -0
- package/runtime/prime/.prime/agent/spec-manifest.json +2 -2
- package/runtime/prime/AGENTS.md +62 -58
- package/runtime/prime/bin/activity-action.sh +92 -0
- package/runtime/prime/bin/activity-data.sh +12 -233
- package/runtime/prime/bin/agent.sh +84 -100
- package/runtime/prime/bin/artifact-register.sh +164 -0
- package/runtime/prime/bin/artifact-writeback.sh +53 -0
- package/runtime/prime/bin/artifacts.sh +288 -0
- package/runtime/prime/bin/build-sealed-dataroom.mjs +722 -0
- package/runtime/prime/bin/capture-run.sh +18 -2
- package/runtime/prime/bin/codex-render-spec.mjs +41 -16
- package/runtime/prime/bin/codex-session-start.sh +14 -4
- package/runtime/prime/bin/codex-skill-render.mjs +9 -7
- package/runtime/prime/bin/corpus_map.py +806 -0
- package/runtime/prime/bin/corpus_survey.py +304 -0
- package/runtime/prime/bin/dashboard-data.sh +11 -171
- package/runtime/prime/bin/github-auth.sh +121 -0
- package/runtime/prime/bin/graph-batch.sh +7 -0
- package/runtime/prime/bin/graph-op.sh +4 -0
- package/runtime/prime/bin/graph-projection.sh +54 -0
- package/runtime/prime/bin/graph-wal.sh +13 -0
- package/runtime/prime/bin/graph.sh +44 -0
- package/runtime/prime/bin/handoff-lifecycle-job.sh +146 -0
- package/runtime/prime/bin/handoff-lifecycle.sh +280 -0
- package/runtime/prime/bin/handoff-preview.sh +169 -0
- package/runtime/prime/bin/handoff-run.sh +42 -26
- package/runtime/prime/bin/ingest-graph.sh +6 -0
- package/runtime/prime/bin/ingest-item.sh +10 -0
- package/runtime/prime/bin/ingest.sh +59 -30
- package/runtime/prime/bin/invite.sh +6 -0
- package/runtime/prime/bin/issue.sh +10 -0
- package/runtime/prime/bin/knowledge.sh +10 -0
- package/runtime/prime/bin/lib/config.sh +20 -0
- package/runtime/prime/bin/lib/context.sh +46 -25
- package/runtime/prime/bin/lib/git-sync.sh +70 -6
- package/runtime/prime/bin/lib/greeting.sh +34 -5
- package/runtime/prime/bin/lib/handoff-meta.sh +97 -0
- package/runtime/prime/bin/lib/worktree-links.sh +6 -0
- package/runtime/prime/bin/node-run.sh +42 -0
- package/runtime/prime/bin/notification.sh +6 -0
- package/runtime/prime/bin/observe-context.sh +14 -0
- package/runtime/prime/bin/onboarding.sh +6 -0
- package/runtime/prime/bin/person.py +4 -0
- package/runtime/prime/bin/person.sh +43 -10
- package/runtime/prime/bin/pi-observe-context.mjs +93 -0
- package/runtime/prime/bin/pi-product-workflows.mjs +1 -1
- package/runtime/prime/bin/pi-render-spec.mjs +140 -0
- package/runtime/prime/bin/post-update.sh +37 -0
- package/runtime/prime/bin/prime-render-spec.mjs +1 -1
- package/runtime/prime/bin/publish-artifact.sh +55 -2
- package/runtime/prime/bin/quest.sh +9 -0
- package/runtime/prime/bin/question.sh +8 -0
- package/runtime/prime/bin/research-ingest.sh +7 -0
- package/runtime/prime/bin/restore-owned-skills.sh +67 -0
- package/runtime/prime/bin/retrieval_eval.py +385 -0
- package/runtime/prime/bin/runtime-identity.sh +70 -0
- package/runtime/prime/bin/runtime-upgrade.sh +43 -0
- package/runtime/prime/bin/scroll.sh +9 -0
- package/runtime/prime/bin/search.sh +231 -195
- package/runtime/prime/bin/settings.sh +174 -5
- package/runtime/prime/bin/startup-check.sh +136 -0
- package/runtime/prime/bin/telemetry.sh +522 -247
- package/runtime/prime/bin/test-changes.sh +344 -0
- package/runtime/prime/bin/thread.sh +9 -0
- package/runtime/prime/bin/todo.sh +9 -0
- package/runtime/prime/bin/view-render.sh +126 -0
- package/runtime/prime/bin/worktree-create.sh +19 -5
- package/runtime/prime/egregore_runtime/__init__.py +228 -0
- package/runtime/prime/egregore_runtime/adapters/__init__.py +5 -0
- package/runtime/prime/egregore_runtime/adapters/invitation.py +237 -0
- package/runtime/prime/egregore_runtime/adapters/notification.py +59 -0
- package/runtime/prime/egregore_runtime/adapters/qmd.py +1701 -0
- package/runtime/prime/egregore_runtime/adapters/qmd_cli.py +210 -0
- package/runtime/prime/egregore_runtime/adapters/qmd_embed_worker.py +59 -0
- package/runtime/prime/egregore_runtime/admin_gate.py +102 -0
- package/runtime/prime/egregore_runtime/artifacts.py +523 -0
- package/runtime/prime/egregore_runtime/contracts.py +499 -0
- package/runtime/prime/egregore_runtime/entitlements.py +85 -0
- package/runtime/prime/egregore_runtime/errors.py +10 -0
- package/runtime/prime/egregore_runtime/graph.py +356 -0
- package/runtime/prime/egregore_runtime/handoff_lookup.py +196 -0
- package/runtime/prime/egregore_runtime/harness_cli.py +1221 -0
- package/runtime/prime/egregore_runtime/identity.py +734 -0
- package/runtime/prime/egregore_runtime/identity_cli.py +91 -0
- package/runtime/prime/egregore_runtime/ingest.py +575 -0
- package/runtime/prime/egregore_runtime/ingest_cli.py +254 -0
- package/runtime/prime/egregore_runtime/ingest_index_cli.py +147 -0
- package/runtime/prime/egregore_runtime/invitation_cli.py +51 -0
- package/runtime/prime/egregore_runtime/invitations.py +116 -0
- package/runtime/prime/egregore_runtime/issue_cli.py +305 -0
- package/runtime/prime/egregore_runtime/issues.py +359 -0
- package/runtime/prime/egregore_runtime/knowledge.py +376 -0
- package/runtime/prime/egregore_runtime/knowledge_cli.py +173 -0
- package/runtime/prime/egregore_runtime/lifecycle.py +888 -0
- package/runtime/prime/egregore_runtime/lifecycle_cli.py +269 -0
- package/runtime/prime/egregore_runtime/notification_cli.py +125 -0
- package/runtime/prime/egregore_runtime/notifications.py +230 -0
- package/runtime/prime/egregore_runtime/observe.py +342 -0
- package/runtime/prime/egregore_runtime/onboarding.py +290 -0
- package/runtime/prime/egregore_runtime/onboarding_cli.py +110 -0
- package/runtime/prime/egregore_runtime/policy.py +144 -0
- package/runtime/prime/egregore_runtime/profile.py +193 -0
- package/runtime/prime/egregore_runtime/quest_cli.py +216 -0
- package/runtime/prime/egregore_runtime/question_cli.py +180 -0
- package/runtime/prime/egregore_runtime/questions.py +304 -0
- package/runtime/prime/egregore_runtime/quests.py +419 -0
- package/runtime/prime/egregore_runtime/readiness.py +379 -0
- package/runtime/prime/egregore_runtime/research_ingest.py +256 -0
- package/runtime/prime/egregore_runtime/research_ingest_cli.py +44 -0
- package/runtime/prime/egregore_runtime/runtime.py +464 -0
- package/runtime/prime/egregore_runtime/scroll_cli.py +185 -0
- package/runtime/prime/egregore_runtime/scrolls.py +726 -0
- package/runtime/prime/egregore_runtime/status.py +412 -0
- package/runtime/prime/egregore_runtime/status_cli.py +174 -0
- package/runtime/prime/egregore_runtime/sync.py +218 -0
- package/runtime/prime/egregore_runtime/teamsync.py +139 -0
- package/runtime/prime/egregore_runtime/telemetry.py +640 -0
- package/runtime/prime/egregore_runtime/thread_cli.py +173 -0
- package/runtime/prime/egregore_runtime/threads.py +517 -0
- package/runtime/prime/egregore_runtime/todo_cli.py +142 -0
- package/runtime/prime/egregore_runtime/todos.py +244 -0
- package/runtime/prime/egregore_runtime/upgrade.py +770 -0
- package/runtime/prime/egregore_runtime/upgrade_worker.py +53 -0
- package/runtime/prime/egregore_runtime/writeback.py +391 -0
- package/runtime/prime/egregore_runtime/writeback_cli.py +114 -0
- package/runtime/prime/manifest.json +98 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"""Detached preparation worker for the transactional Runtime upgrade.
|
|
2
|
+
|
|
3
|
+
Runs the staged engine for one instance with stdio fully detached, so the
|
|
4
|
+
launching surface (Settings, CLI) returns immediately and reconnects later
|
|
5
|
+
through the durable state file. Progress survives the terminal session; an
|
|
6
|
+
interrupted run resumes completed stages instead of restarting them.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import argparse
|
|
12
|
+
import os
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _parser() -> argparse.ArgumentParser:
|
|
17
|
+
parser = argparse.ArgumentParser(prog="egregore-runtime-upgrade-worker")
|
|
18
|
+
parser.add_argument("--repository-root", type=Path, required=True)
|
|
19
|
+
return parser
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def main() -> int:
|
|
23
|
+
args = _parser().parse_args()
|
|
24
|
+
root = args.repository_root.resolve()
|
|
25
|
+
|
|
26
|
+
from .adapters.qmd import QmdLocalRetriever
|
|
27
|
+
from .runtime import local_runtime
|
|
28
|
+
from .upgrade import UpgradeEngine, UpgradeStore, upgrade_root
|
|
29
|
+
|
|
30
|
+
store = UpgradeStore(root=upgrade_root(root))
|
|
31
|
+
engine = UpgradeEngine(
|
|
32
|
+
repository_root=root,
|
|
33
|
+
store=store,
|
|
34
|
+
runtime=local_runtime(root, push_remote=False),
|
|
35
|
+
retriever=QmdLocalRetriever(repository_root=root),
|
|
36
|
+
)
|
|
37
|
+
try:
|
|
38
|
+
state = engine.prepare()
|
|
39
|
+
except Exception as exc: # a detached process records, never raises
|
|
40
|
+
current = store.load()
|
|
41
|
+
if current is not None:
|
|
42
|
+
current["status"] = "failed"
|
|
43
|
+
current["failure"] = {
|
|
44
|
+
"stage": "worker",
|
|
45
|
+
"message": f"{type(exc).__name__}: {exc}"[:300],
|
|
46
|
+
}
|
|
47
|
+
store.write(current)
|
|
48
|
+
return 1
|
|
49
|
+
return 0 if state.get("status") in ("ready-to-activate", "active") else 1
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
if __name__ == "__main__":
|
|
53
|
+
raise SystemExit(main())
|
|
@@ -0,0 +1,391 @@
|
|
|
1
|
+
"""Canonical artifact writeback orchestration.
|
|
2
|
+
|
|
3
|
+
The orchestrator deliberately knows only domain protocols. Git, QMD, graph,
|
|
4
|
+
and telemetry implementations stay behind their respective adapters.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import uuid
|
|
10
|
+
from dataclasses import replace
|
|
11
|
+
from datetime import UTC, datetime
|
|
12
|
+
from typing import Callable, Sequence
|
|
13
|
+
|
|
14
|
+
from .artifacts import (
|
|
15
|
+
ARTIFACT_SCHEMA_VERSION,
|
|
16
|
+
CanonicalArtifactStore,
|
|
17
|
+
CanonicalDocument,
|
|
18
|
+
artifact_id_from_path,
|
|
19
|
+
canonical_relative_path,
|
|
20
|
+
content_digest,
|
|
21
|
+
validate_artifact,
|
|
22
|
+
)
|
|
23
|
+
from .contracts import (
|
|
24
|
+
ActionAuthorizer,
|
|
25
|
+
ActorContext,
|
|
26
|
+
CanonicalArtifact,
|
|
27
|
+
GraphProjection,
|
|
28
|
+
Permission,
|
|
29
|
+
Retriever,
|
|
30
|
+
SyncTransport,
|
|
31
|
+
TelemetryEvent,
|
|
32
|
+
TelemetrySink,
|
|
33
|
+
WritebackEvent,
|
|
34
|
+
WritebackStatus,
|
|
35
|
+
)
|
|
36
|
+
from .telemetry import TELEMETRY_SCHEMA_VERSION
|
|
37
|
+
from .policy import scope_allows_path
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class CanonicalArtifactWriteback:
|
|
41
|
+
"""Authorize and persist canonical state, then update disposable projections."""
|
|
42
|
+
|
|
43
|
+
def __init__(
|
|
44
|
+
self,
|
|
45
|
+
*,
|
|
46
|
+
authorizer: ActionAuthorizer,
|
|
47
|
+
store: CanonicalArtifactStore,
|
|
48
|
+
sync_transport: SyncTransport,
|
|
49
|
+
retriever: Retriever,
|
|
50
|
+
telemetry: TelemetrySink,
|
|
51
|
+
graph: GraphProjection | None = None,
|
|
52
|
+
clock: Callable[[], datetime] | None = None,
|
|
53
|
+
id_factory: Callable[[], str] | None = None,
|
|
54
|
+
) -> None:
|
|
55
|
+
self.authorizer = authorizer
|
|
56
|
+
self.store = store
|
|
57
|
+
self.sync_transport = sync_transport
|
|
58
|
+
self.retriever = retriever
|
|
59
|
+
self.telemetry = telemetry
|
|
60
|
+
self.graph = graph
|
|
61
|
+
self.clock = clock or (lambda: datetime.now(UTC))
|
|
62
|
+
self.id_factory = id_factory or (lambda: f"writeback-{uuid.uuid4().hex}")
|
|
63
|
+
|
|
64
|
+
def _event_id(self) -> str:
|
|
65
|
+
return self.id_factory()
|
|
66
|
+
|
|
67
|
+
def _emit(
|
|
68
|
+
self,
|
|
69
|
+
*,
|
|
70
|
+
actor: ActorContext,
|
|
71
|
+
event_id: str,
|
|
72
|
+
artifact_id: str,
|
|
73
|
+
status: WritebackStatus,
|
|
74
|
+
warning_count: int,
|
|
75
|
+
) -> None:
|
|
76
|
+
self.telemetry.emit(
|
|
77
|
+
TelemetryEvent(
|
|
78
|
+
schema_version=TELEMETRY_SCHEMA_VERSION,
|
|
79
|
+
event_id=f"telemetry-{event_id}",
|
|
80
|
+
event_type=f"writeback.{status.value}",
|
|
81
|
+
occurred_at=self.clock(),
|
|
82
|
+
org_id=actor.profile.org_id,
|
|
83
|
+
actor_id=actor.actor.actor_id,
|
|
84
|
+
session_id=actor.session_id,
|
|
85
|
+
org_revision=actor.profile.revision,
|
|
86
|
+
metrics={
|
|
87
|
+
"count": warning_count,
|
|
88
|
+
"writeback_result": status.value,
|
|
89
|
+
"success": status is WritebackStatus.ACCEPTED,
|
|
90
|
+
},
|
|
91
|
+
artifact_ids=(artifact_id,) if artifact_id else (),
|
|
92
|
+
)
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
def _prepare(
|
|
96
|
+
self,
|
|
97
|
+
actor: ActorContext,
|
|
98
|
+
artifact: CanonicalArtifact,
|
|
99
|
+
content: str,
|
|
100
|
+
*,
|
|
101
|
+
policy_hints: dict[str, object] | None = None,
|
|
102
|
+
source_document: CanonicalDocument | None = None,
|
|
103
|
+
) -> CanonicalDocument:
|
|
104
|
+
if artifact.org_id != actor.profile.org_id:
|
|
105
|
+
raise ValueError("artifact organization does not match the active actor context")
|
|
106
|
+
path = canonical_relative_path(artifact.canonical_path)
|
|
107
|
+
digest = content_digest(content)
|
|
108
|
+
prepared = replace(
|
|
109
|
+
artifact,
|
|
110
|
+
schema_version=ARTIFACT_SCHEMA_VERSION,
|
|
111
|
+
artifact_id=artifact.artifact_id or artifact_id_from_path(path),
|
|
112
|
+
canonical_path=path,
|
|
113
|
+
created_by=(
|
|
114
|
+
actor.actor.actor_id
|
|
115
|
+
if source_document is not None and source_document.migrated_from is not None
|
|
116
|
+
else artifact.created_by or actor.actor.actor_id
|
|
117
|
+
),
|
|
118
|
+
revision=artifact.revision or f"sha256:{digest[:16]}",
|
|
119
|
+
content_hash=digest,
|
|
120
|
+
)
|
|
121
|
+
return CanonicalDocument(
|
|
122
|
+
artifact=validate_artifact(prepared, content),
|
|
123
|
+
body=content,
|
|
124
|
+
policy_hints=policy_hints or {},
|
|
125
|
+
legacy_fields=(source_document.legacy_fields if source_document else {}),
|
|
126
|
+
migrated_from=(source_document.migrated_from if source_document else None),
|
|
127
|
+
warnings=(source_document.warnings if source_document else ()),
|
|
128
|
+
)
|
|
129
|
+
|
|
130
|
+
def write(
|
|
131
|
+
self,
|
|
132
|
+
actor: ActorContext,
|
|
133
|
+
artifact: CanonicalArtifact,
|
|
134
|
+
content: str,
|
|
135
|
+
) -> WritebackEvent:
|
|
136
|
+
return self._write(actor, artifact, content, policy_hints={}, source_document=None)
|
|
137
|
+
|
|
138
|
+
def write_document(
|
|
139
|
+
self,
|
|
140
|
+
actor: ActorContext,
|
|
141
|
+
document: CanonicalDocument,
|
|
142
|
+
) -> WritebackEvent:
|
|
143
|
+
"""Richer local API that preserves advisory envelope policy hints."""
|
|
144
|
+
|
|
145
|
+
return self._write(
|
|
146
|
+
actor,
|
|
147
|
+
document.artifact,
|
|
148
|
+
document.body,
|
|
149
|
+
policy_hints=dict(document.policy_hints),
|
|
150
|
+
source_document=document,
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
def write_documents(
|
|
154
|
+
self,
|
|
155
|
+
actor: ActorContext,
|
|
156
|
+
documents: Sequence[CanonicalDocument],
|
|
157
|
+
) -> tuple[WritebackEvent, ...]:
|
|
158
|
+
"""Persist a validated artifact set with one provenance/projection cycle."""
|
|
159
|
+
|
|
160
|
+
if not documents:
|
|
161
|
+
return ()
|
|
162
|
+
event_id = self._event_id()
|
|
163
|
+
resources = tuple(
|
|
164
|
+
document.artifact.artifact_id or document.artifact.canonical_path
|
|
165
|
+
for document in documents
|
|
166
|
+
)
|
|
167
|
+
decision = self.authorizer.authorize_action(actor, Permission.WRITE, resources)
|
|
168
|
+
if not decision.allowed:
|
|
169
|
+
warnings = tuple(decision.reasons)
|
|
170
|
+
return tuple(
|
|
171
|
+
WritebackEvent(
|
|
172
|
+
event_id=f"{event_id}-{index}",
|
|
173
|
+
artifact=document.artifact,
|
|
174
|
+
permission_decision=decision,
|
|
175
|
+
status=WritebackStatus.REJECTED,
|
|
176
|
+
warnings=warnings,
|
|
177
|
+
)
|
|
178
|
+
for index, document in enumerate(documents, start=1)
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
prepared = tuple(
|
|
182
|
+
self._prepare(
|
|
183
|
+
actor,
|
|
184
|
+
document.artifact,
|
|
185
|
+
document.body,
|
|
186
|
+
policy_hints=dict(document.policy_hints),
|
|
187
|
+
source_document=document,
|
|
188
|
+
)
|
|
189
|
+
for document in documents
|
|
190
|
+
)
|
|
191
|
+
if decision.scopes:
|
|
192
|
+
outside = tuple(
|
|
193
|
+
document.artifact.canonical_path
|
|
194
|
+
for document in prepared
|
|
195
|
+
if not scope_allows_path(
|
|
196
|
+
f"memory/{document.artifact.canonical_path}", decision.scopes
|
|
197
|
+
)
|
|
198
|
+
)
|
|
199
|
+
if outside:
|
|
200
|
+
raise PermissionError("canonical write path is outside the actor's authorized scope")
|
|
201
|
+
|
|
202
|
+
persisted_paths = tuple(self.store.persist(document) for document in prepared)
|
|
203
|
+
artifacts = tuple(document.artifact for document in prepared)
|
|
204
|
+
warnings: list[str] = []
|
|
205
|
+
git_revision: str | None = None
|
|
206
|
+
index_revision: str | None = None
|
|
207
|
+
embedding_state: str | None = None
|
|
208
|
+
|
|
209
|
+
try:
|
|
210
|
+
sync = self.sync_transport.push(
|
|
211
|
+
message=f"docs(memory): capture {len(artifacts)} artifacts",
|
|
212
|
+
paths=tuple(str(path) for path in persisted_paths),
|
|
213
|
+
)
|
|
214
|
+
git_revision = sync.local_revision
|
|
215
|
+
warnings.extend(f"sync: {warning}" for warning in sync.warnings)
|
|
216
|
+
except Exception as exc:
|
|
217
|
+
warnings.append(f"sync: {exc}")
|
|
218
|
+
|
|
219
|
+
if git_revision is None:
|
|
220
|
+
warnings.append("retrieval: skipped because canonical Git provenance failed")
|
|
221
|
+
else:
|
|
222
|
+
try:
|
|
223
|
+
health = self.retriever.update(tuple(str(path) for path in persisted_paths))
|
|
224
|
+
index_revision = health.index_revision
|
|
225
|
+
if not health.available:
|
|
226
|
+
warnings.append("retrieval: index unavailable after canonical write")
|
|
227
|
+
warnings.extend(f"retrieval: {warning}" for warning in health.warnings)
|
|
228
|
+
except Exception as exc:
|
|
229
|
+
warnings.append(f"retrieval update: {exc}")
|
|
230
|
+
try:
|
|
231
|
+
health = self.retriever.embed_background()
|
|
232
|
+
embedding_state = health.embedding_state
|
|
233
|
+
warnings.extend(f"embedding: {warning}" for warning in health.warnings)
|
|
234
|
+
except Exception as exc:
|
|
235
|
+
warnings.append(f"embedding: {exc}")
|
|
236
|
+
|
|
237
|
+
if self.graph is not None and git_revision is not None:
|
|
238
|
+
try:
|
|
239
|
+
health = self.graph.project(artifacts)
|
|
240
|
+
if health.enabled:
|
|
241
|
+
warnings.extend(f"graph: {warning}" for warning in health.warnings)
|
|
242
|
+
if health.consistent is False:
|
|
243
|
+
warnings.append("graph: projection is inconsistent with canonical state")
|
|
244
|
+
except Exception as exc:
|
|
245
|
+
warnings.append(f"graph: {exc}")
|
|
246
|
+
|
|
247
|
+
status = WritebackStatus.PARTIAL if warnings else WritebackStatus.ACCEPTED
|
|
248
|
+
receipts = tuple(
|
|
249
|
+
WritebackEvent(
|
|
250
|
+
event_id=f"{event_id}-{index}",
|
|
251
|
+
artifact=artifact,
|
|
252
|
+
permission_decision=decision,
|
|
253
|
+
status=status,
|
|
254
|
+
git_revision=git_revision,
|
|
255
|
+
index_revision=index_revision,
|
|
256
|
+
embedding_state=embedding_state,
|
|
257
|
+
warnings=tuple(warnings),
|
|
258
|
+
)
|
|
259
|
+
for index, artifact in enumerate(artifacts, start=1)
|
|
260
|
+
)
|
|
261
|
+
for receipt in receipts:
|
|
262
|
+
try:
|
|
263
|
+
self._emit(
|
|
264
|
+
actor=actor,
|
|
265
|
+
event_id=receipt.event_id,
|
|
266
|
+
artifact_id=receipt.artifact.artifact_id,
|
|
267
|
+
status=status,
|
|
268
|
+
warning_count=len(warnings),
|
|
269
|
+
)
|
|
270
|
+
except Exception as exc:
|
|
271
|
+
warnings.append(f"telemetry: {exc}")
|
|
272
|
+
status = WritebackStatus.PARTIAL
|
|
273
|
+
if status is WritebackStatus.PARTIAL and any(
|
|
274
|
+
receipt.status is WritebackStatus.ACCEPTED for receipt in receipts
|
|
275
|
+
):
|
|
276
|
+
receipts = tuple(replace(receipt, status=status, warnings=tuple(warnings)) for receipt in receipts)
|
|
277
|
+
return receipts
|
|
278
|
+
|
|
279
|
+
def _write(
|
|
280
|
+
self,
|
|
281
|
+
actor: ActorContext,
|
|
282
|
+
artifact: CanonicalArtifact,
|
|
283
|
+
content: str,
|
|
284
|
+
*,
|
|
285
|
+
policy_hints: dict[str, object],
|
|
286
|
+
source_document: CanonicalDocument | None,
|
|
287
|
+
) -> WritebackEvent:
|
|
288
|
+
event_id = self._event_id()
|
|
289
|
+
resource = artifact.artifact_id or artifact.canonical_path
|
|
290
|
+
decision = self.authorizer.authorize_action(actor, Permission.WRITE, (resource,))
|
|
291
|
+
if not decision.allowed:
|
|
292
|
+
warnings = tuple(decision.reasons)
|
|
293
|
+
try:
|
|
294
|
+
self._emit(
|
|
295
|
+
actor=actor,
|
|
296
|
+
event_id=event_id,
|
|
297
|
+
artifact_id=artifact.artifact_id,
|
|
298
|
+
status=WritebackStatus.REJECTED,
|
|
299
|
+
warning_count=len(warnings),
|
|
300
|
+
)
|
|
301
|
+
except Exception:
|
|
302
|
+
warnings += ("telemetry: failed to record denied writeback",)
|
|
303
|
+
return WritebackEvent(
|
|
304
|
+
event_id=event_id,
|
|
305
|
+
artifact=artifact,
|
|
306
|
+
permission_decision=decision,
|
|
307
|
+
status=WritebackStatus.REJECTED,
|
|
308
|
+
warnings=warnings,
|
|
309
|
+
)
|
|
310
|
+
|
|
311
|
+
path = canonical_relative_path(artifact.canonical_path)
|
|
312
|
+
if decision.scopes and not scope_allows_path(f"memory/{path}", decision.scopes):
|
|
313
|
+
raise PermissionError("canonical write path is outside the actor's authorized scope")
|
|
314
|
+
|
|
315
|
+
document = self._prepare(
|
|
316
|
+
actor,
|
|
317
|
+
artifact,
|
|
318
|
+
content,
|
|
319
|
+
policy_hints=policy_hints,
|
|
320
|
+
source_document=source_document,
|
|
321
|
+
)
|
|
322
|
+
persisted_path = self.store.persist(document)
|
|
323
|
+
artifact = document.artifact
|
|
324
|
+
|
|
325
|
+
warnings: list[str] = []
|
|
326
|
+
git_revision: str | None = None
|
|
327
|
+
index_revision: str | None = None
|
|
328
|
+
embedding_state: str | None = None
|
|
329
|
+
|
|
330
|
+
try:
|
|
331
|
+
sync = self.sync_transport.push(
|
|
332
|
+
message=f"docs(memory): capture {artifact.artifact_type}",
|
|
333
|
+
paths=(str(persisted_path),),
|
|
334
|
+
)
|
|
335
|
+
git_revision = sync.local_revision
|
|
336
|
+
warnings.extend(f"sync: {warning}" for warning in sync.warnings)
|
|
337
|
+
except Exception as exc:
|
|
338
|
+
warnings.append(f"sync: {exc}")
|
|
339
|
+
|
|
340
|
+
if git_revision is None:
|
|
341
|
+
warnings.append("retrieval: skipped because canonical Git provenance failed")
|
|
342
|
+
else:
|
|
343
|
+
try:
|
|
344
|
+
health = self.retriever.update((str(persisted_path),))
|
|
345
|
+
index_revision = health.index_revision
|
|
346
|
+
if not health.available:
|
|
347
|
+
warnings.append("retrieval: index unavailable after canonical write")
|
|
348
|
+
warnings.extend(f"retrieval: {warning}" for warning in health.warnings)
|
|
349
|
+
except Exception as exc:
|
|
350
|
+
warnings.append(f"retrieval update: {exc}")
|
|
351
|
+
|
|
352
|
+
try:
|
|
353
|
+
health = self.retriever.embed_background()
|
|
354
|
+
embedding_state = health.embedding_state
|
|
355
|
+
warnings.extend(f"embedding: {warning}" for warning in health.warnings)
|
|
356
|
+
except Exception as exc:
|
|
357
|
+
warnings.append(f"embedding: {exc}")
|
|
358
|
+
|
|
359
|
+
if self.graph is not None and git_revision is not None:
|
|
360
|
+
try:
|
|
361
|
+
health = self.graph.project((artifact,))
|
|
362
|
+
if health.enabled:
|
|
363
|
+
warnings.extend(f"graph: {warning}" for warning in health.warnings)
|
|
364
|
+
if health.consistent is False:
|
|
365
|
+
warnings.append("graph: projection is inconsistent with canonical state")
|
|
366
|
+
except Exception as exc:
|
|
367
|
+
warnings.append(f"graph: {exc}")
|
|
368
|
+
|
|
369
|
+
status = WritebackStatus.PARTIAL if warnings else WritebackStatus.ACCEPTED
|
|
370
|
+
try:
|
|
371
|
+
self._emit(
|
|
372
|
+
actor=actor,
|
|
373
|
+
event_id=event_id,
|
|
374
|
+
artifact_id=artifact.artifact_id,
|
|
375
|
+
status=status,
|
|
376
|
+
warning_count=len(warnings),
|
|
377
|
+
)
|
|
378
|
+
except Exception as exc:
|
|
379
|
+
warnings.append(f"telemetry: {exc}")
|
|
380
|
+
status = WritebackStatus.PARTIAL
|
|
381
|
+
|
|
382
|
+
return WritebackEvent(
|
|
383
|
+
event_id=event_id,
|
|
384
|
+
artifact=artifact,
|
|
385
|
+
permission_decision=decision,
|
|
386
|
+
status=status,
|
|
387
|
+
git_revision=git_revision,
|
|
388
|
+
index_revision=index_revision,
|
|
389
|
+
embedding_state=embedding_state,
|
|
390
|
+
warnings=tuple(warnings),
|
|
391
|
+
)
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"""Internal shell bridge to the canonical artifact/writeback service."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import os
|
|
8
|
+
import sys
|
|
9
|
+
import uuid
|
|
10
|
+
from pathlib import Path
|
|
11
|
+
|
|
12
|
+
from .artifacts import parse_canonical_markdown
|
|
13
|
+
from .contracts import Permission
|
|
14
|
+
from .runtime import local_runtime
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def _root() -> Path:
|
|
18
|
+
return Path(os.environ.get("EGREGORE_ROOT") or Path.cwd()).resolve()
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
def _adopt(args: argparse.Namespace) -> int:
|
|
22
|
+
root = _root()
|
|
23
|
+
memory = (root / "memory").resolve()
|
|
24
|
+
source = Path(args.path)
|
|
25
|
+
if not source.is_absolute():
|
|
26
|
+
source = root / source
|
|
27
|
+
# Capture workers report the checkout-facing memory symlink. Resolve both
|
|
28
|
+
# sides before enforcing containment so a legitimate instance-owned
|
|
29
|
+
# canonical write is not mistaken for an external path.
|
|
30
|
+
source = source.resolve()
|
|
31
|
+
try:
|
|
32
|
+
relative = source.relative_to(memory).as_posix()
|
|
33
|
+
except ValueError as exc:
|
|
34
|
+
raise ValueError("canonical artifact must be inside memory/") from exc
|
|
35
|
+
|
|
36
|
+
runtime = local_runtime(root, push_remote=not args.no_push)
|
|
37
|
+
actor = runtime.resolve_actor(
|
|
38
|
+
session_id=os.environ.get("EGREGORE_SESSION_ID", f"session_{uuid.uuid4().hex}"),
|
|
39
|
+
harness=os.environ.get("EGREGORE_RUNTIME", "shell"),
|
|
40
|
+
)
|
|
41
|
+
document = parse_canonical_markdown(
|
|
42
|
+
source.read_text(encoding="utf-8"),
|
|
43
|
+
canonical_path=relative,
|
|
44
|
+
default_org_id=actor.profile.org_id,
|
|
45
|
+
)
|
|
46
|
+
receipt = runtime.write_document(actor, document)
|
|
47
|
+
print(json.dumps(receipt.to_dict(), ensure_ascii=False))
|
|
48
|
+
return 0 if receipt.status.value in {"accepted", "partial"} else 1
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _create(args: argparse.Namespace) -> int:
|
|
52
|
+
root = _root()
|
|
53
|
+
runtime = local_runtime(root, push_remote=not args.no_push)
|
|
54
|
+
actor = runtime.resolve_actor(
|
|
55
|
+
session_id=os.environ.get("EGREGORE_SESSION_ID", f"session_{uuid.uuid4().hex}"),
|
|
56
|
+
harness=os.environ.get("EGREGORE_RUNTIME", "shell"),
|
|
57
|
+
)
|
|
58
|
+
source = Path(args.input).resolve()
|
|
59
|
+
document = parse_canonical_markdown(
|
|
60
|
+
source.read_text(encoding="utf-8"),
|
|
61
|
+
canonical_path=args.path.removeprefix("memory/"),
|
|
62
|
+
default_org_id=actor.profile.org_id,
|
|
63
|
+
)
|
|
64
|
+
receipt = runtime.write_document(actor, document)
|
|
65
|
+
print(json.dumps(receipt.to_dict(), ensure_ascii=False))
|
|
66
|
+
return 0 if receipt.status.value in {"accepted", "partial"} else 1
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def _authorize(args: argparse.Namespace) -> int:
|
|
70
|
+
root = _root()
|
|
71
|
+
runtime = local_runtime(root, push_remote=False)
|
|
72
|
+
actor = runtime.resolve_actor(
|
|
73
|
+
session_id=os.environ.get("EGREGORE_SESSION_ID", f"session_{uuid.uuid4().hex}"),
|
|
74
|
+
harness=os.environ.get("EGREGORE_RUNTIME", "shell"),
|
|
75
|
+
)
|
|
76
|
+
decision = runtime.authorize(
|
|
77
|
+
actor,
|
|
78
|
+
Permission(args.permission),
|
|
79
|
+
(args.resource,) if args.resource else (),
|
|
80
|
+
)
|
|
81
|
+
print(json.dumps(decision.to_dict(), ensure_ascii=False))
|
|
82
|
+
return 0 if decision.allowed else 1
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
def _parser() -> argparse.ArgumentParser:
|
|
86
|
+
parser = argparse.ArgumentParser(prog="egregore-artifact-writeback")
|
|
87
|
+
commands = parser.add_subparsers(dest="command", required=True)
|
|
88
|
+
adopt = commands.add_parser("adopt")
|
|
89
|
+
adopt.add_argument("path")
|
|
90
|
+
adopt.add_argument("--no-push", action="store_true")
|
|
91
|
+
adopt.set_defaults(handler=_adopt)
|
|
92
|
+
create = commands.add_parser("create")
|
|
93
|
+
create.add_argument("--path", required=True)
|
|
94
|
+
create.add_argument("--input", required=True)
|
|
95
|
+
create.add_argument("--no-push", action="store_true")
|
|
96
|
+
create.set_defaults(handler=_create)
|
|
97
|
+
authorize = commands.add_parser("authorize")
|
|
98
|
+
authorize.add_argument("permission", choices=[item.value for item in Permission])
|
|
99
|
+
authorize.add_argument("--resource")
|
|
100
|
+
authorize.set_defaults(handler=_authorize)
|
|
101
|
+
return parser
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
def main() -> int:
|
|
105
|
+
args = _parser().parse_args()
|
|
106
|
+
return args.handler(args)
|
|
107
|
+
|
|
108
|
+
|
|
109
|
+
if __name__ == "__main__":
|
|
110
|
+
try:
|
|
111
|
+
raise SystemExit(main())
|
|
112
|
+
except (OSError, ValueError) as exc:
|
|
113
|
+
print(f"writeback: {exc}", file=sys.stderr)
|
|
114
|
+
raise SystemExit(1) from exc
|