-
Notifications
You must be signed in to change notification settings - Fork 1
feat(agentic-org): git-as-database-and-event-store + observe.ts keystone + constitution gate + metrics/review board #6071
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AceHack
merged 62 commits into
main
from
feat/observe-composer-run-state-zetaid-sync-2026-05-29
May 30, 2026
Merged
Changes from all commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
322392a
feat(agentic-org): observe.ts run-state keystone + ZetaId/git-sync + …
maximdolphin e4e1014
feat(agentic-org): git-as-database-and-event-store via frontmatter + …
maximdolphin 53c0e34
feat(agentic-org): frontmatter YAML codec, schema<->SQL + git<->cockr…
maximdolphin 8f36fee
feat(agentic-org): git/cockroach sync adapters + reconcile worker; qu…
maximdolphin 55eedcd
feat(agentic-org): slice 1 — state reconciliation table (North Star p…
maximdolphin fe42b61
feat(agentic-org): slice 2 — supervisor triage action resolver (North…
maximdolphin 2c2e0f9
feat(agentic-org): slice 3 — agent-native knowledge graph projection …
maximdolphin 61ddf57
feat(agentic-org): slice 4 — wire observe.ts to real work-item state
maximdolphin 06e3cdf
feat(agentic-org): slice 5 — review board as a real gate
maximdolphin e2c1e4a
docs(agentic-org): slice 6 — doc coherence (status frontmatter + Nort…
maximdolphin fe8128b
fix(agentic-org): MD018 reflow in NORTH_STAR_ALIGNMENT_CHECKPOINT
claude 7568d23
fix(agentic-org): install @nats-io v3 + pg deps — unblocks workers te…
maximdolphin d454c1f
feat(agentic-org): Phase 3 — deterministic keep-alive (org + agent li…
maximdolphin e19a8de
feat(agentic-org): Phase 4 — Hermes runtime + Hindsight memory + orch…
maximdolphin 33e40d0
feat(agentic-org): Phase 5 — bootable process host + container substr…
maximdolphin c019a1d
feat(agentic-org): wire deterministic keep-alive as a third worker-ru…
maximdolphin d9c5a97
feat(agentic-org): make the deterministic keep-alive real — Cockroach…
maximdolphin 4ac430c
docs(agentic-org): checkpoint — deterministic keep-alive control plan…
maximdolphin 3733717
feat(agentic-org): k8s deploy substrate — cockroach + nats + worker m…
maximdolphin 2856bc5
feat(agentic-org): k8s deadline tuning + spin-up-task publisher
maximdolphin cdf945d
docs(agentic-org): Phase 6 checkpoint — running in kubernetes-in-dock…
maximdolphin 82c3d06
feat(agentic-org): agent liveness is real — second half of keep-alive…
maximdolphin c934313
docs(agentic-org): Phase 7 checkpoint — agent liveness real, both hal…
maximdolphin 02e5c83
feat(agentic-org): wire the orchestration's Hermes heartbeat to the a…
maximdolphin 22efcd8
docs(agentic-org): consolidation + honest status — keep-alive tenet #…
maximdolphin 65b9170
feat(agentic-org): integrate the Hermes data plane into the deployed …
maximdolphin 7ba4507
docs(agentic-org): Phase 9 capstone — autonomous data plane runs end-…
maximdolphin 2e8c435
docs(agentic-org): the full watch loop closes in k8s — keep-alive cau…
maximdolphin 2e1e984
fix(lint): MD032 blanks-around-lists in NORTH_STAR_ALIGNMENT_CHECKPOI…
claude f6d1d12
feat(agentic-org): independent fast keep-alive loop — decouple the he…
maximdolphin 711b7f5
docs(agentic-org): independent keep-alive loop proven in k8s — heartb…
maximdolphin 7bbb9d3
feat(agentic-org): durable Cockroach-backed Hindsight memory, wired i…
maximdolphin ac0d040
feat(agentic-org): durable Cockroach-backed Hermes runs, wired into t…
maximdolphin 4bed8cc
fix(agentic-org): durable Hermes/memory id-collision + JSONB cast (ca…
maximdolphin 286cbc0
docs(agentic-org): durable data plane runs to completion in k8s; live…
maximdolphin 81c3df6
fix(markdownlint): MD032 blank lines around two lists in NORTH_STAR c…
claude 3383ebe
feat(agentic-org): composed organization reaction-plan executor (agen…
maximdolphin 4d838db
feat(workers): produce durable org artifacts in deployed worker
maximdolphin 697059b
docs: record Phase 12 org-artifact command pipeline proven in-cluster
maximdolphin 968147f
feat(application): agent decisions computed by the deterministic kernel
maximdolphin 6f3a3a8
docs: record Phase 13 computed agent decision proven in-cluster
maximdolphin 5a2f908
docs: record operator tenet #1 holistic keep-alive proof (org v594, 1…
maximdolphin f1055f2
feat: live LLM decision backend + real sandboxed tool execution
maximdolphin c2dd159
docs: record Phase 14 live LLM + sandboxed-tool backend proven in-clu…
maximdolphin bcace47
fix(lint): clear markdownlint MD032/MD026 in NORTH_STAR_ALIGNMENT_CHE…
claude b8fa461
fix(review): resolve all 7 Copilot review findings on PR #6071
maximdolphin 711536e
feat(org): P0 blueprint + P1 org structure as data (16 depts + ~115 h…
maximdolphin 808d3cb
feat(org): P2 hat binding lifecycle + expiry + succession + OrgEvent …
maximdolphin 26ae95b
feat(org): P3 prioritization (directors/TPMs) + RMO hat-supply voting
maximdolphin 960d6da
feat(org): P4 assignment engine (rank by reputation, assign within su…
maximdolphin 82e9fd1
feat(org): P5 work pipeline driver (customer discovery -> release)
maximdolphin 5682fa5
feat(org): P6 observability — org snapshot + Cockroach org_events/hat…
maximdolphin 5fe5c83
feat(org): P7a org runtime — full end-to-end cycle ties all layers
maximdolphin 2c363b1
feat(org): P7 end-to-end org cycle proven in kind — full hierarchy to…
maximdolphin 7e77842
docs: record P7 — full hat+department org proven end-to-end in kind (…
maximdolphin e707441
fix(lint): clear markdownlint MD022 on P7 checkpoint heading
maximdolphin d469f5c
docs: design the dynamic memory system (hat+agent+work memory, weight…
maximdolphin 6c0dec1
fix(agentic-org): unblock markdownlint — reflow line-leading `+` in O…
claude 4bfb99c
docs(memory): add retrieval/storage reliability model + Hindsight int…
maximdolphin 12597af
docs(memory): close 5 design gaps + ground Hindsight integration in i…
maximdolphin f8cce07
docs(work-os): W0 — gap audit + overhaul design for a true agentic Wo…
maximdolphin 8a72a46
fix(agentic-org): close 2 Copilot P1 review findings on #6071
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| node_modules | ||
| **/*.test.ts | ||
| docs | ||
| .git | ||
| .gitignore | ||
| *.md | ||
| deploy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # Agentic Organization worker runtime. | ||
| # | ||
| # The code runs directly via `node --experimental-strip-types` (no build step, | ||
| # no bundler) per the repo convention. node:24-slim (Debian) is used over Alpine | ||
| # so the `pg` and @nats-io native paths resolve against glibc cleanly. | ||
| FROM node:24-slim | ||
|
|
||
| WORKDIR /app | ||
|
|
||
| # Install only production deps first for layer caching. package-lock.json is the | ||
| # pinned dependency graph (@nats-io/jetstream, @nats-io/transport-node, pg). | ||
| COPY package.json package-lock.json ./ | ||
| RUN npm ci --omit=dev | ||
|
|
||
| # Copy the source. No compile — strip-types runs the .ts directly. | ||
| COPY tsconfig.json ./ | ||
| COPY packages ./packages | ||
| COPY apps ./apps | ||
|
|
||
| # Run as the non-root node user (defense in depth; the worker needs no root). | ||
| USER node | ||
|
|
||
| # The worker is a long-running process driven by the always-on loop. SIGTERM is | ||
| # handled by the entrypoint (graceful shutdown of cockroach + nats ports). | ||
| ENV NODE_ENV=production | ||
| ENTRYPOINT ["node", "--experimental-strip-types", "apps/workers/src/main.ts"] |
64 changes: 64 additions & 0 deletions
64
agentic-organization/apps/workers/src/adapters/ollama-chat-port.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| /** | ||
| * Ollama chat adapter — a real ChatCompletionPort backed by a model served by | ||
| * Ollama (https://ollama.com). Runs entirely in-cluster (no external | ||
| * credentials): the worker POSTs to the in-cluster Ollama service and the model | ||
| * returns its choice. This is the agent's live decision backend. | ||
| * | ||
| * Bounded by an AbortController timeout so a slow/hung model never stalls the | ||
| * agent run (the model-backed composer falls back to the deterministic policy | ||
| * when this throws — the agent stays alive). | ||
| */ | ||
|
|
||
| import type { ChatCompletionPort, ChatCompletionRequest } from "../../../../packages/application/src/index.ts"; | ||
|
|
||
| export type CreateOllamaChatPortInput = { | ||
| baseUrl: string; | ||
| model: string; | ||
| timeoutMs?: number; | ||
| /** injected for testability; defaults to global fetch */ | ||
| fetchImpl?: typeof fetch; | ||
| }; | ||
|
|
||
| type OllamaChatResponse = { | ||
| message?: { content?: string }; | ||
| }; | ||
|
|
||
| export function createOllamaChatPort(input: CreateOllamaChatPortInput): ChatCompletionPort { | ||
| const fetchImpl = input.fetchImpl ?? fetch; | ||
| const timeoutMs = input.timeoutMs ?? 20_000; | ||
| const url = `${input.baseUrl.replace(/\/+$/, "")}/api/chat`; | ||
|
|
||
| return { | ||
| complete: async (request: ChatCompletionRequest): Promise<string> => { | ||
| const controller = new AbortController(); | ||
| const timer = setTimeout(() => controller.abort(), timeoutMs); | ||
| try { | ||
| const response = await fetchImpl(url, { | ||
| method: "POST", | ||
| headers: { "content-type": "application/json" }, | ||
| body: JSON.stringify({ | ||
| model: input.model, | ||
| stream: false, | ||
| options: { temperature: 0 }, | ||
| messages: [ | ||
| { role: "system", content: request.system }, | ||
| { role: "user", content: request.user }, | ||
| ], | ||
| }), | ||
| signal: controller.signal, | ||
| }); | ||
| if (!response.ok) { | ||
| throw new Error(`ollama chat failed: ${response.status} ${response.statusText}`); | ||
| } | ||
| const body = (await response.json()) as OllamaChatResponse; | ||
| const content = body.message?.content; | ||
| if (typeof content !== "string") { | ||
| throw new Error("ollama chat response had no message content"); | ||
| } | ||
| return content; | ||
| } finally { | ||
| clearTimeout(timer); | ||
| } | ||
| }, | ||
| }; | ||
| } |
70 changes: 70 additions & 0 deletions
70
agentic-organization/apps/workers/src/adapters/subprocess-sandbox.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| /** | ||
| * Subprocess sandbox adapter — a real SandboxToolPort that runs a tool as a | ||
| * bounded, isolated child process: | ||
| * - executed in a throwaway temp dir (isolated cwd), | ||
| * - with a stripped environment (only PATH), so the tool cannot read worker | ||
| * secrets/config, | ||
| * - killed (SIGKILL) on timeout, with output size capped, | ||
| * - never inherits the parent stdio. | ||
| * | ||
| * Result-as-DU: failures (non-zero exit, timeout, spawn error) come back as | ||
| * { ok:false, reason } — the agent run treats tool failure as supplementary, | ||
| * never fatal. | ||
| */ | ||
|
|
||
| import { execFile } from "node:child_process"; | ||
| import { mkdtempSync, rmSync } from "node:fs"; | ||
| import { tmpdir } from "node:os"; | ||
| import { join } from "node:path"; | ||
|
|
||
| import type { SandboxToolPort, SandboxToolRequest, SandboxToolResult } from "../../../../packages/application/src/index.ts"; | ||
|
|
||
| const MAX_OUTPUT_BYTES = 64 * 1024; | ||
|
|
||
| /** POSIX "/..." or Windows "C:\..." / "C:/...". */ | ||
| function isAbsolutePath(command: string): boolean { | ||
| return command.startsWith("/") || /^[A-Za-z]:[\\/]/.test(command); | ||
| } | ||
|
|
||
| export function createSubprocessSandbox(): SandboxToolPort { | ||
| return { | ||
| run: async (request: SandboxToolRequest): Promise<SandboxToolResult> => { | ||
| // The contract requires an absolute command path. A relative command would | ||
| // be resolved via PATH and could execute an unexpected binary, so reject | ||
| // it as a Result rather than spawning it. | ||
| if (!isAbsolutePath(request.command)) { | ||
| return { ok: false, reason: `sandbox command must be an absolute path, got '${request.command}'` }; | ||
| } | ||
| const workdir = mkdtempSync(join(tmpdir(), "agentic-sandbox-")); | ||
| try { | ||
|
maximdolphin marked this conversation as resolved.
maximdolphin marked this conversation as resolved.
|
||
| return await new Promise<SandboxToolResult>((resolve) => { | ||
| execFile( | ||
| request.command, | ||
| [...request.args], | ||
| { | ||
| cwd: workdir, | ||
| timeout: request.timeoutMs, | ||
| killSignal: "SIGKILL", | ||
| maxBuffer: MAX_OUTPUT_BYTES, | ||
| encoding: "utf8", | ||
| // stripped env: only PATH, so the tool cannot read worker secrets | ||
| env: { PATH: process.env["PATH"] ?? "/usr/local/bin:/usr/bin:/bin" }, | ||
| windowsHide: true, | ||
| }, | ||
| (error, stdout) => { | ||
| if (error !== null) { | ||
| resolve({ ok: false, reason: error.message }); | ||
| return; | ||
| } | ||
| resolve({ ok: true, stdout }); | ||
| }, | ||
| ); | ||
| }); | ||
| } catch (error) { | ||
| return { ok: false, reason: error instanceof Error ? error.message : String(error) }; | ||
| } finally { | ||
| rmSync(workdir, { recursive: true, force: true }); | ||
| } | ||
| }, | ||
| }; | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.