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,499 @@
|
|
|
1
|
+
"""Stable domain contracts for the Egregore organizational runtime.
|
|
2
|
+
|
|
3
|
+
The module intentionally uses only Python's standard library. It is a domain
|
|
4
|
+
boundary, not an infrastructure SDK. Concrete adapters may use Pydantic,
|
|
5
|
+
QMD, Supabase, Neo4j, Git, or a local daemon behind these protocols.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from dataclasses import asdict, dataclass, field
|
|
11
|
+
from datetime import datetime
|
|
12
|
+
from enum import StrEnum
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
from typing import TYPE_CHECKING, Any, Mapping, Protocol, Sequence, runtime_checkable
|
|
15
|
+
|
|
16
|
+
if TYPE_CHECKING:
|
|
17
|
+
from .artifacts import CanonicalDocument
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
JsonObject = Mapping[str, Any]
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class ActorKind(StrEnum):
|
|
24
|
+
PERSON = "person"
|
|
25
|
+
AGENT = "agent"
|
|
26
|
+
SERVICE = "service"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class Permission(StrEnum):
|
|
30
|
+
DISCOVER = "discover"
|
|
31
|
+
READ = "read"
|
|
32
|
+
WRITE = "write"
|
|
33
|
+
EXECUTE = "execute"
|
|
34
|
+
SHARE = "share"
|
|
35
|
+
PROMOTE = "promote"
|
|
36
|
+
ADMINISTER = "administer"
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
class Capability(StrEnum):
|
|
40
|
+
CANONICAL_MEMORY_LOCAL = "canonical-memory.local"
|
|
41
|
+
RETRIEVAL_LOCAL = "retrieval.local"
|
|
42
|
+
EMBEDDINGS_LOCAL = "embeddings.local"
|
|
43
|
+
TELEMETRY_LOCAL = "telemetry.local"
|
|
44
|
+
IDENTITY_BASIC = "identity.basic"
|
|
45
|
+
POLICY_BASIC = "policy.basic"
|
|
46
|
+
INGEST_MANUAL = "ingest.manual"
|
|
47
|
+
SYNC_GIT = "sync.git"
|
|
48
|
+
GRAPH_PROJECTION = "projection.graph"
|
|
49
|
+
CONNECTED_CONTROL_PLANE = "control-plane.connected"
|
|
50
|
+
CONNECTED_MANAGED_INDEX = "retrieval.managed"
|
|
51
|
+
CONNECTED_CONTINUOUS_INGEST = "ingest.continuous"
|
|
52
|
+
CONNECTED_POLICY_ADMIN = "policy.admin"
|
|
53
|
+
CONNECTED_AUDIT_RETENTION = "telemetry.retained"
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
class RetrievalMode(StrEnum):
|
|
57
|
+
LEX = "lex"
|
|
58
|
+
VEC = "vec"
|
|
59
|
+
HYBRID = "lex+vec"
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
class TemporalScope(StrEnum):
|
|
63
|
+
CURRENT = "current"
|
|
64
|
+
CURRENT_AND_HISTORICAL = "current+historical"
|
|
65
|
+
HISTORICAL = "historical"
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
class WritebackStatus(StrEnum):
|
|
69
|
+
ACCEPTED = "accepted"
|
|
70
|
+
REJECTED = "rejected"
|
|
71
|
+
PARTIAL = "partial"
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@dataclass(frozen=True, slots=True)
|
|
75
|
+
class Serializable:
|
|
76
|
+
"""Small common JSON-shape helper for contract fixtures and adapters."""
|
|
77
|
+
|
|
78
|
+
def to_dict(self) -> dict[str, Any]:
|
|
79
|
+
def convert(value: Any) -> Any:
|
|
80
|
+
if isinstance(value, StrEnum):
|
|
81
|
+
return value.value
|
|
82
|
+
if isinstance(value, datetime):
|
|
83
|
+
return value.isoformat()
|
|
84
|
+
if isinstance(value, Path):
|
|
85
|
+
return str(value)
|
|
86
|
+
if isinstance(value, tuple):
|
|
87
|
+
return [convert(item) for item in value]
|
|
88
|
+
if isinstance(value, frozenset):
|
|
89
|
+
return sorted(convert(item) for item in value)
|
|
90
|
+
if isinstance(value, dict):
|
|
91
|
+
return {key: convert(item) for key, item in value.items()}
|
|
92
|
+
if hasattr(value, "to_dict"):
|
|
93
|
+
return value.to_dict()
|
|
94
|
+
return value
|
|
95
|
+
|
|
96
|
+
return {key: convert(value) for key, value in asdict(self).items()}
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
@dataclass(frozen=True, slots=True)
|
|
100
|
+
class EgregoreProfile(Serializable):
|
|
101
|
+
schema_version: str
|
|
102
|
+
org_id: str
|
|
103
|
+
slug: str
|
|
104
|
+
name: str
|
|
105
|
+
revision: str
|
|
106
|
+
purpose_path: str | None = None
|
|
107
|
+
principles_path: str | None = None
|
|
108
|
+
conventions_path: str | None = None
|
|
109
|
+
default_policy: str = "all-access-v1"
|
|
110
|
+
default_context_budget: int = 8_000
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
@dataclass(frozen=True, slots=True)
|
|
114
|
+
class AccountIdentity(Serializable):
|
|
115
|
+
account_id: str
|
|
116
|
+
display_name: str
|
|
117
|
+
primary_email: str | None = None
|
|
118
|
+
provider_aliases: Mapping[str, str] = field(default_factory=dict)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@dataclass(frozen=True, slots=True)
|
|
122
|
+
class ActorIdentity(Serializable):
|
|
123
|
+
actor_id: str
|
|
124
|
+
kind: ActorKind
|
|
125
|
+
display_name: str
|
|
126
|
+
account_id: str | None = None
|
|
127
|
+
parent_actor_id: str | None = None
|
|
128
|
+
aliases: Mapping[str, str] = field(default_factory=dict)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
@dataclass(frozen=True, slots=True)
|
|
132
|
+
class OrgMembership(Serializable):
|
|
133
|
+
membership_id: str
|
|
134
|
+
org_id: str
|
|
135
|
+
actor_id: str
|
|
136
|
+
roles: tuple[str, ...] = ()
|
|
137
|
+
teams: tuple[str, ...] = ()
|
|
138
|
+
status: str = "active"
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
@dataclass(frozen=True, slots=True)
|
|
142
|
+
class Entitlements(Serializable):
|
|
143
|
+
plan: str
|
|
144
|
+
capabilities: frozenset[Capability]
|
|
145
|
+
source: str
|
|
146
|
+
revision: str
|
|
147
|
+
|
|
148
|
+
def has(self, capability: Capability) -> bool:
|
|
149
|
+
return capability in self.capabilities
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
@dataclass(frozen=True, slots=True)
|
|
153
|
+
class ActorContext(Serializable):
|
|
154
|
+
account: AccountIdentity | None
|
|
155
|
+
actor: ActorIdentity
|
|
156
|
+
profile: EgregoreProfile
|
|
157
|
+
membership: OrgMembership | None
|
|
158
|
+
entitlements: Entitlements
|
|
159
|
+
session_id: str
|
|
160
|
+
harness: str
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
@dataclass(frozen=True, slots=True)
|
|
164
|
+
class PolicyDecision(Serializable):
|
|
165
|
+
allowed: bool
|
|
166
|
+
actor_id: str
|
|
167
|
+
org_id: str
|
|
168
|
+
permission: Permission
|
|
169
|
+
policy_epoch: str
|
|
170
|
+
resource_ids: tuple[str, ...] = ()
|
|
171
|
+
scopes: tuple[str, ...] = ()
|
|
172
|
+
reasons: tuple[str, ...] = ()
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
@dataclass(frozen=True, slots=True)
|
|
176
|
+
class SourceProvenance(Serializable):
|
|
177
|
+
source_type: str
|
|
178
|
+
source_id: str
|
|
179
|
+
revision: str
|
|
180
|
+
content_hash: str
|
|
181
|
+
observed_at: datetime
|
|
182
|
+
source_uri: str | None = None
|
|
183
|
+
imported_by: str | None = None
|
|
184
|
+
|
|
185
|
+
|
|
186
|
+
@dataclass(frozen=True, slots=True)
|
|
187
|
+
class ArtifactRelationship(Serializable):
|
|
188
|
+
relation: str
|
|
189
|
+
target_id: str
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
@dataclass(frozen=True, slots=True)
|
|
193
|
+
class CanonicalArtifact(Serializable):
|
|
194
|
+
schema_version: str
|
|
195
|
+
artifact_id: str
|
|
196
|
+
org_id: str
|
|
197
|
+
artifact_type: str
|
|
198
|
+
title: str
|
|
199
|
+
created_at: datetime
|
|
200
|
+
created_by: str
|
|
201
|
+
status: str
|
|
202
|
+
canonical_path: str
|
|
203
|
+
revision: str
|
|
204
|
+
content_hash: str
|
|
205
|
+
workstream: str | None = None
|
|
206
|
+
visibility: tuple[str, ...] = ()
|
|
207
|
+
relationships: tuple[ArtifactRelationship, ...] = ()
|
|
208
|
+
supersedes: tuple[str, ...] = ()
|
|
209
|
+
provenance: tuple[SourceProvenance, ...] = ()
|
|
210
|
+
|
|
211
|
+
|
|
212
|
+
@dataclass(frozen=True, slots=True)
|
|
213
|
+
class IngestSource(Serializable):
|
|
214
|
+
source_type: str
|
|
215
|
+
source_id: str
|
|
216
|
+
revision: str
|
|
217
|
+
content_hash: str
|
|
218
|
+
observed_at: datetime
|
|
219
|
+
title: str | None = None
|
|
220
|
+
source_uri: str | None = None
|
|
221
|
+
visibility: tuple[str, ...] = ()
|
|
222
|
+
metadata: Mapping[str, Any] = field(default_factory=dict)
|
|
223
|
+
|
|
224
|
+
|
|
225
|
+
@dataclass(frozen=True, slots=True)
|
|
226
|
+
class RetrievalRequest(Serializable):
|
|
227
|
+
request_id: str
|
|
228
|
+
org_id: str
|
|
229
|
+
actor_id: str
|
|
230
|
+
task: str
|
|
231
|
+
lex: tuple[str, ...]
|
|
232
|
+
vec: tuple[str, ...]
|
|
233
|
+
top_k: int = 6
|
|
234
|
+
mode: RetrievalMode = RetrievalMode.HYBRID
|
|
235
|
+
authorized_scopes: tuple[str, ...] = ()
|
|
236
|
+
allowed_artifact_ids: tuple[str, ...] = ()
|
|
237
|
+
artifact_types: tuple[str, ...] = ()
|
|
238
|
+
workstream: str | None = None
|
|
239
|
+
source_revision: str | None = None
|
|
240
|
+
open_sources: bool = True
|
|
241
|
+
temporal_scope: TemporalScope = TemporalScope.CURRENT
|
|
242
|
+
not_before: datetime | None = None
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
@dataclass(frozen=True, slots=True)
|
|
246
|
+
class RetrievalHit(Serializable):
|
|
247
|
+
artifact_id: str
|
|
248
|
+
canonical_path: str
|
|
249
|
+
rank: int
|
|
250
|
+
score: float
|
|
251
|
+
retrieval_types: tuple[RetrievalMode, ...]
|
|
252
|
+
passage: str | None = None
|
|
253
|
+
passage_id: str | None = None
|
|
254
|
+
revision: str | None = None
|
|
255
|
+
content_hash: str | None = None
|
|
256
|
+
observed_at: datetime | None = None
|
|
257
|
+
|
|
258
|
+
|
|
259
|
+
@dataclass(frozen=True, slots=True)
|
|
260
|
+
class RetrievalResult(Serializable):
|
|
261
|
+
request_id: str
|
|
262
|
+
mode: RetrievalMode
|
|
263
|
+
hits: tuple[RetrievalHit, ...]
|
|
264
|
+
index_spec_version: str
|
|
265
|
+
index_revision: str
|
|
266
|
+
source_revision: str
|
|
267
|
+
latency_ms: int
|
|
268
|
+
degraded: bool = False
|
|
269
|
+
warnings: tuple[str, ...] = ()
|
|
270
|
+
# Canonical revision the served vector build represents; None when the
|
|
271
|
+
# executed retrieval used no vectors. Trails source_revision while a
|
|
272
|
+
# newer embedding builds — hybrid stays available throughout.
|
|
273
|
+
semantic_source_revision: str | None = None
|
|
274
|
+
|
|
275
|
+
|
|
276
|
+
@dataclass(frozen=True, slots=True)
|
|
277
|
+
class EvidenceItem(Serializable):
|
|
278
|
+
artifact_id: str
|
|
279
|
+
canonical_path: str
|
|
280
|
+
revision: str
|
|
281
|
+
reason: str
|
|
282
|
+
content: str
|
|
283
|
+
token_count: int
|
|
284
|
+
provenance: tuple[SourceProvenance, ...] = ()
|
|
285
|
+
|
|
286
|
+
|
|
287
|
+
@dataclass(frozen=True, slots=True)
|
|
288
|
+
class OrgContext(Serializable):
|
|
289
|
+
schema_version: str
|
|
290
|
+
context_id: str
|
|
291
|
+
org_id: str
|
|
292
|
+
actor_id: str
|
|
293
|
+
task: str
|
|
294
|
+
profile_revision: str
|
|
295
|
+
source_revision: str
|
|
296
|
+
policy_epoch: str
|
|
297
|
+
evidence: tuple[EvidenceItem, ...]
|
|
298
|
+
action_permissions: frozenset[Permission]
|
|
299
|
+
token_budget: int
|
|
300
|
+
tokens_used: int
|
|
301
|
+
omissions: tuple[str, ...] = ()
|
|
302
|
+
freshness: Mapping[str, str] = field(default_factory=dict)
|
|
303
|
+
|
|
304
|
+
|
|
305
|
+
@dataclass(frozen=True, slots=True)
|
|
306
|
+
class TelemetryEvent(Serializable):
|
|
307
|
+
schema_version: str
|
|
308
|
+
event_id: str
|
|
309
|
+
event_type: str
|
|
310
|
+
occurred_at: datetime
|
|
311
|
+
org_id: str
|
|
312
|
+
actor_id: str
|
|
313
|
+
session_id: str
|
|
314
|
+
task_id: str | None = None
|
|
315
|
+
org_revision: str | None = None
|
|
316
|
+
index_spec_version: str | None = None
|
|
317
|
+
metrics: Mapping[str, int | float | bool | str | None] = field(default_factory=dict)
|
|
318
|
+
artifact_ids: tuple[str, ...] = ()
|
|
319
|
+
shared: bool = False
|
|
320
|
+
|
|
321
|
+
|
|
322
|
+
@dataclass(frozen=True, slots=True)
|
|
323
|
+
class WritebackEvent(Serializable):
|
|
324
|
+
event_id: str
|
|
325
|
+
artifact: CanonicalArtifact
|
|
326
|
+
permission_decision: PolicyDecision
|
|
327
|
+
status: WritebackStatus
|
|
328
|
+
git_revision: str | None = None
|
|
329
|
+
index_revision: str | None = None
|
|
330
|
+
embedding_state: str | None = None
|
|
331
|
+
warnings: tuple[str, ...] = ()
|
|
332
|
+
|
|
333
|
+
|
|
334
|
+
@dataclass(frozen=True, slots=True)
|
|
335
|
+
class RetrieverHealth(Serializable):
|
|
336
|
+
available: bool
|
|
337
|
+
adapter: str
|
|
338
|
+
adapter_version: str
|
|
339
|
+
index_spec_version: str
|
|
340
|
+
index_revision: str
|
|
341
|
+
source_revision: str
|
|
342
|
+
embedding_state: str
|
|
343
|
+
warnings: tuple[str, ...] = ()
|
|
344
|
+
canonical_state_ready: bool = False
|
|
345
|
+
bm25_ready: bool = False
|
|
346
|
+
semantic_ready: bool = False
|
|
347
|
+
runtime_state: str = "runtime_unavailable"
|
|
348
|
+
runtime_pid: int | None = None
|
|
349
|
+
runtime_endpoint: str | None = None
|
|
350
|
+
index_path: str | None = None
|
|
351
|
+
collection: str | None = None
|
|
352
|
+
index_source_revision: str | None = None
|
|
353
|
+
# Canonical revision of the last complete vector build (the revision
|
|
354
|
+
# hybrid retrieval serves while semantic_ready is still false).
|
|
355
|
+
semantic_source_revision: str | None = None
|
|
356
|
+
|
|
357
|
+
|
|
358
|
+
@dataclass(frozen=True, slots=True)
|
|
359
|
+
class GraphProjectionHealth(Serializable):
|
|
360
|
+
enabled: bool
|
|
361
|
+
adapter: str
|
|
362
|
+
projection_revision: str | None
|
|
363
|
+
canonical_revision: str
|
|
364
|
+
coverage: float | None = None
|
|
365
|
+
consistent: bool | None = None
|
|
366
|
+
warnings: tuple[str, ...] = ()
|
|
367
|
+
|
|
368
|
+
|
|
369
|
+
@dataclass(frozen=True, slots=True)
|
|
370
|
+
class SyncStatus(Serializable):
|
|
371
|
+
transport: str
|
|
372
|
+
local_revision: str
|
|
373
|
+
remote_revision: str | None
|
|
374
|
+
clean: bool
|
|
375
|
+
warnings: tuple[str, ...] = ()
|
|
376
|
+
current: bool = True
|
|
377
|
+
changed: bool = False
|
|
378
|
+
|
|
379
|
+
|
|
380
|
+
@dataclass(frozen=True, slots=True)
|
|
381
|
+
class SynchronizationReceipt(Serializable):
|
|
382
|
+
"""Canonical sync and disposable retrieval readiness as one result."""
|
|
383
|
+
|
|
384
|
+
schema_version: str
|
|
385
|
+
status: str
|
|
386
|
+
canonical_sync: SyncStatus | None
|
|
387
|
+
retrieval: RetrieverHealth | None
|
|
388
|
+
canonical_current: bool
|
|
389
|
+
index_source_aligned: bool
|
|
390
|
+
semantic_building: bool
|
|
391
|
+
failures: tuple[str, ...] = ()
|
|
392
|
+
|
|
393
|
+
|
|
394
|
+
@runtime_checkable
|
|
395
|
+
class IdentityResolver(Protocol):
|
|
396
|
+
def resolve(self, *, session_id: str, harness: str) -> ActorContext: ...
|
|
397
|
+
|
|
398
|
+
|
|
399
|
+
@runtime_checkable
|
|
400
|
+
class ActionAuthorizer(Protocol):
|
|
401
|
+
def authorize_observe(
|
|
402
|
+
self, actor: ActorContext, request: RetrievalRequest
|
|
403
|
+
) -> PolicyDecision: ...
|
|
404
|
+
|
|
405
|
+
def authorize_action(
|
|
406
|
+
self,
|
|
407
|
+
actor: ActorContext,
|
|
408
|
+
permission: Permission,
|
|
409
|
+
resource_ids: Sequence[str] = (),
|
|
410
|
+
) -> PolicyDecision: ...
|
|
411
|
+
|
|
412
|
+
|
|
413
|
+
@runtime_checkable
|
|
414
|
+
class Retriever(Protocol):
|
|
415
|
+
def health(self) -> RetrieverHealth: ...
|
|
416
|
+
|
|
417
|
+
def retrieve(self, request: RetrievalRequest) -> RetrievalResult: ...
|
|
418
|
+
|
|
419
|
+
def open_source(self, hit: RetrievalHit) -> str: ...
|
|
420
|
+
|
|
421
|
+
def update(self, paths: Sequence[str] = ()) -> RetrieverHealth: ...
|
|
422
|
+
|
|
423
|
+
def embed_background(self) -> RetrieverHealth: ...
|
|
424
|
+
|
|
425
|
+
|
|
426
|
+
@runtime_checkable
|
|
427
|
+
class RetrievalRuntimeControl(Protocol):
|
|
428
|
+
"""Optional lifecycle surface for persistent retrieval implementations."""
|
|
429
|
+
|
|
430
|
+
def start(self) -> RetrieverHealth: ...
|
|
431
|
+
|
|
432
|
+
def shutdown(self) -> RetrieverHealth: ...
|
|
433
|
+
|
|
434
|
+
|
|
435
|
+
@runtime_checkable
|
|
436
|
+
class GraphProjection(Protocol):
|
|
437
|
+
def health(self) -> GraphProjectionHealth: ...
|
|
438
|
+
|
|
439
|
+
def project(self, artifacts: Sequence[CanonicalArtifact]) -> GraphProjectionHealth: ...
|
|
440
|
+
|
|
441
|
+
def rebuild(self) -> GraphProjectionHealth: ...
|
|
442
|
+
|
|
443
|
+
def verify(self) -> GraphProjectionHealth: ...
|
|
444
|
+
|
|
445
|
+
|
|
446
|
+
@runtime_checkable
|
|
447
|
+
class TelemetrySink(Protocol):
|
|
448
|
+
def emit(self, event: TelemetryEvent) -> None: ...
|
|
449
|
+
|
|
450
|
+
def inspect(self, *, limit: int = 100) -> Sequence[TelemetryEvent]: ...
|
|
451
|
+
|
|
452
|
+
def export(self, destination: Path) -> Path: ...
|
|
453
|
+
|
|
454
|
+
|
|
455
|
+
@runtime_checkable
|
|
456
|
+
class Ingestor(Protocol):
|
|
457
|
+
def normalize(self, source: IngestSource, payload: bytes) -> CanonicalArtifact: ...
|
|
458
|
+
|
|
459
|
+
|
|
460
|
+
@runtime_checkable
|
|
461
|
+
class ArtifactWriteback(Protocol):
|
|
462
|
+
def write(
|
|
463
|
+
self,
|
|
464
|
+
actor: ActorContext,
|
|
465
|
+
artifact: CanonicalArtifact,
|
|
466
|
+
content: str,
|
|
467
|
+
) -> WritebackEvent: ...
|
|
468
|
+
|
|
469
|
+
def write_document(
|
|
470
|
+
self,
|
|
471
|
+
actor: ActorContext,
|
|
472
|
+
document: "CanonicalDocument",
|
|
473
|
+
) -> WritebackEvent: ...
|
|
474
|
+
|
|
475
|
+
def write_documents(
|
|
476
|
+
self,
|
|
477
|
+
actor: ActorContext,
|
|
478
|
+
documents: Sequence["CanonicalDocument"],
|
|
479
|
+
) -> Sequence[WritebackEvent]: ...
|
|
480
|
+
|
|
481
|
+
|
|
482
|
+
@runtime_checkable
|
|
483
|
+
class SyncTransport(Protocol):
|
|
484
|
+
def status(self) -> SyncStatus: ...
|
|
485
|
+
|
|
486
|
+
def pull(self) -> SyncStatus: ...
|
|
487
|
+
|
|
488
|
+
def push(self, *, message: str, paths: Sequence[str] = ()) -> SyncStatus: ...
|
|
489
|
+
|
|
490
|
+
|
|
491
|
+
@runtime_checkable
|
|
492
|
+
class OrgContextCompiler(Protocol):
|
|
493
|
+
def observe(
|
|
494
|
+
self,
|
|
495
|
+
actor: ActorContext,
|
|
496
|
+
request: RetrievalRequest,
|
|
497
|
+
*,
|
|
498
|
+
token_budget: int,
|
|
499
|
+
) -> OrgContext: ...
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"""Central plan/status to runtime-capability translation.
|
|
2
|
+
|
|
3
|
+
Capability decisions are intentionally separate from authorization. Local
|
|
4
|
+
safety, identity, policy, and canonical memory do not disappear when a paid
|
|
5
|
+
entitlement is absent or inactive.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from __future__ import annotations
|
|
9
|
+
|
|
10
|
+
from collections.abc import Iterable, Mapping
|
|
11
|
+
from typing import Any
|
|
12
|
+
|
|
13
|
+
from .contracts import Capability, Entitlements
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
CAPABILITY_REVISION = "egregore-capabilities/v1"
|
|
17
|
+
ACTIVE_ENTITLEMENT_STATUSES = frozenset({"active", "trialing"})
|
|
18
|
+
|
|
19
|
+
LOCAL_CAPABILITIES = frozenset(
|
|
20
|
+
{
|
|
21
|
+
Capability.CANONICAL_MEMORY_LOCAL,
|
|
22
|
+
Capability.RETRIEVAL_LOCAL,
|
|
23
|
+
Capability.EMBEDDINGS_LOCAL,
|
|
24
|
+
Capability.TELEMETRY_LOCAL,
|
|
25
|
+
Capability.IDENTITY_BASIC,
|
|
26
|
+
Capability.POLICY_BASIC,
|
|
27
|
+
Capability.INGEST_MANUAL,
|
|
28
|
+
Capability.SYNC_GIT,
|
|
29
|
+
}
|
|
30
|
+
)
|
|
31
|
+
|
|
32
|
+
# Only capabilities backed by current shared infrastructure are implicit.
|
|
33
|
+
# Future managed retrieval/ingest/policy products require an explicit
|
|
34
|
+
# capability grant from the control plane instead of inheriting from a price.
|
|
35
|
+
PLAN_CAPABILITIES: Mapping[str, frozenset[Capability]] = {
|
|
36
|
+
"local": frozenset(),
|
|
37
|
+
"free": frozenset(),
|
|
38
|
+
"connect": frozenset({Capability.CONNECTED_CONTROL_PLANE}),
|
|
39
|
+
"connected": frozenset({Capability.CONNECTED_CONTROL_PLANE}),
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
def _parse_capabilities(values: Iterable[str | Capability]) -> frozenset[Capability]:
|
|
44
|
+
result: set[Capability] = set()
|
|
45
|
+
for value in values:
|
|
46
|
+
try:
|
|
47
|
+
result.add(value if isinstance(value, Capability) else Capability(value))
|
|
48
|
+
except ValueError:
|
|
49
|
+
# Forward-compatible control-plane rows may contain capabilities
|
|
50
|
+
# this older Local runtime does not know yet.
|
|
51
|
+
continue
|
|
52
|
+
return frozenset(result)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
def resolve_entitlements(
|
|
56
|
+
*,
|
|
57
|
+
mode: str = "local",
|
|
58
|
+
row: Mapping[str, Any] | None = None,
|
|
59
|
+
) -> Entitlements:
|
|
60
|
+
"""Resolve capabilities from Local defaults plus an optional shared row."""
|
|
61
|
+
|
|
62
|
+
entitlement = dict(row or {})
|
|
63
|
+
plan = str(entitlement.get("plan") or ("connect" if mode == "connected" else "local")).lower()
|
|
64
|
+
status = str(entitlement.get("status") or ("active" if mode == "local" else "inactive")).lower()
|
|
65
|
+
capabilities = set(LOCAL_CAPABILITIES)
|
|
66
|
+
|
|
67
|
+
if status in ACTIVE_ENTITLEMENT_STATUSES:
|
|
68
|
+
capabilities.update(PLAN_CAPABILITIES.get(plan, ()))
|
|
69
|
+
metadata = entitlement.get("metadata") or {}
|
|
70
|
+
if isinstance(metadata, Mapping):
|
|
71
|
+
explicit = metadata.get("capabilities") or ()
|
|
72
|
+
if isinstance(explicit, (list, tuple, set, frozenset)):
|
|
73
|
+
capabilities.update(_parse_capabilities(explicit))
|
|
74
|
+
|
|
75
|
+
revision = str(
|
|
76
|
+
entitlement.get("updated_at")
|
|
77
|
+
or entitlement.get("id")
|
|
78
|
+
or CAPABILITY_REVISION
|
|
79
|
+
)
|
|
80
|
+
return Entitlements(
|
|
81
|
+
plan=plan,
|
|
82
|
+
capabilities=frozenset(capabilities),
|
|
83
|
+
source="supabase" if row is not None else "local-defaults",
|
|
84
|
+
revision=revision,
|
|
85
|
+
)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
class EgregoreRuntimeError(RuntimeError):
|
|
2
|
+
"""Base error for domain-level runtime failures."""
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class AuthorizationDenied(EgregoreRuntimeError):
|
|
6
|
+
"""The actor is not authorized to observe or perform an action."""
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class ContextBudgetError(EgregoreRuntimeError):
|
|
10
|
+
"""The requested context budget cannot hold a valid manifest."""
|