sept-agent 0.1.2 → 0.1.4

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.
Files changed (52) hide show
  1. package/CONTRIBUTING.md +8 -4
  2. package/README.md +33 -8
  3. package/dist/src/cli/commands.js +4 -0
  4. package/dist/src/cli/commands.js.map +1 -1
  5. package/dist/src/cli/hands-docker.d.ts +7 -0
  6. package/dist/src/cli/hands-docker.js +182 -0
  7. package/dist/src/cli/hands-docker.js.map +1 -0
  8. package/dist/src/cli/hands-finish.d.ts +2 -0
  9. package/dist/src/cli/hands-finish.js +164 -0
  10. package/dist/src/cli/hands-finish.js.map +1 -0
  11. package/dist/src/cli/hands-owner.d.ts +10 -0
  12. package/dist/src/cli/hands-owner.js +83 -0
  13. package/dist/src/cli/hands-owner.js.map +1 -0
  14. package/dist/src/cli/hands-record.d.ts +33 -0
  15. package/dist/src/cli/hands-record.js +164 -0
  16. package/dist/src/cli/hands-record.js.map +1 -0
  17. package/dist/src/cli/hands.d.ts +3 -0
  18. package/dist/src/cli/hands.js +169 -0
  19. package/dist/src/cli/hands.js.map +1 -0
  20. package/dist/src/cli/options.d.ts +1 -0
  21. package/dist/src/cli/options.js +2 -1
  22. package/dist/src/cli/options.js.map +1 -1
  23. package/dist/src/cli.js +1 -1
  24. package/dist/src/cli.js.map +1 -1
  25. package/dist/src/execution/hands-process-owner.d.ts +2 -4
  26. package/dist/src/execution/hands-process-owner.js +3 -1
  27. package/dist/src/execution/hands-process-owner.js.map +1 -1
  28. package/dist/src/execution/index.d.ts +4 -0
  29. package/dist/src/execution/index.js +4 -0
  30. package/dist/src/execution/index.js.map +1 -1
  31. package/examples/incident-investigator/README.md +4 -4
  32. package/examples/incident-investigator/package.json +1 -1
  33. package/examples/node-app/README.md +4 -4
  34. package/examples/node-app/package.json +1 -1
  35. package/package.json +1 -8
  36. package/src/cli/commands.ts +4 -0
  37. package/src/cli/hands-docker.ts +198 -0
  38. package/src/cli/hands-finish.ts +204 -0
  39. package/src/cli/hands-owner.ts +118 -0
  40. package/src/cli/hands-record.ts +213 -0
  41. package/src/cli/hands.ts +207 -0
  42. package/src/cli/options.ts +3 -1
  43. package/src/cli.ts +1 -1
  44. package/src/execution/hands-process-owner.ts +4 -5
  45. package/src/execution/index.ts +10 -0
  46. package/docs/architecture.md +0 -168
  47. package/docs/index.md +0 -55
  48. package/docs/models.md +0 -78
  49. package/docs/observability.md +0 -63
  50. package/docs/pi-contract.md +0 -482
  51. package/docs/sdk.md +0 -180
  52. package/docs/worker-api.md +0 -138
@@ -1,168 +0,0 @@
1
- # SEPT module map
2
-
3
- SEPT exposes three npm entries over one runtime: `sept-agent` composes a complete worker, `sept-agent/client` is bounded HTTP transport, and `sept-agent/hands` exposes existing trusted operator configuration/filter helpers. Only those entries are consumer APIs.
4
-
5
- SEPT is organized by the mechanisms it owns. Each mechanism has one public `index.ts`; production callers outside that folder use that surface rather than implementation files. Focused tests may import an implementation directly when doing so avoids widening a runtime facade.
6
-
7
- ```text
8
- src/
9
- index.ts export-only root npm entry
10
- hands.ts export-only operator npm entry
11
- worker-api.ts shared public worker contracts/identical function binding
12
- hands-api.ts shared public hands contracts/identical helper bindings
13
- package-metadata.ts import-safe installed package/Pi metadata
14
- worker/
15
- index.ts internal complete-composition boundary
16
- worker.ts createWorker, bound readiness and shared idempotent stop
17
- capabilities.ts shared CLI/factory/direct policy and Pi/backend wiring
18
- client/
19
- index.ts export-only public client entry and type-only DTOs
20
- client.ts five existing HTTP operations, stable caller IDs
21
- request-codecs.ts origin/header/identifier/page/request bounds
22
- response-codecs.ts unknown JSON, durable DTO/status/identity/cursor checks
23
- transport.ts fetch, first abort/timeout, streamed byte bounds
24
- errors.ts fixed safe TaskClientError classifications
25
- cli.ts installed dispatch, argv/env/defaults/signals/telemetry
26
- cli/
27
- auth-interaction.ts terminal adapter for Pi AuthInteraction
28
- model-access/
29
- index.ts intentional public surface
30
- contracts.ts credential-blind provider/model/auth/selection DTOs
31
- input.ts hostile-object narrowing at configuration boundaries
32
- jsonc.ts bounded JSONC parsing for Pi models.json
33
- custom-configuration.ts endpoint, credential, and rollover-metadata safety
34
- model-metadata.ts identifiers, model limits, and built-in fallback pair
35
- pod-selection.ts atomic credential-free Pod default persistence
36
- normalization.ts credential-blind Pi metadata and error projection
37
- runtime-factory.ts validated installed Pi ModelRuntime construction
38
- service.ts catalogue, authentication, selection, and preflight facade
39
- durable/
40
- index.ts durable state public surface
41
- contracts.ts run, task, handover, conversation, lifecycle contracts
42
- errors.ts classified durability and capacity failures
43
- limits.ts queue, record, conversation, and control bounds
44
- filesystem.ts atomic files, fsync ordering, bounded JSONL scanning
45
- validation-primitives.ts shared hostile-input narrowing primitives
46
- state-codecs.ts manifest and lifecycle-snapshot codecs
47
- evidence-codecs.ts event, message, conversation, and readiness codecs
48
- control-codecs.ts assistant control and handover validation
49
- lease.ts stable process identity and exclusive durable leases
50
- run-evidence.ts sequenced internal events and bounded lifecycle logs
51
- conversation-store.ts bounded client conversation retention and recovery
52
- operator-queue.ts exact input admission, proof, and compaction
53
- context-transfer-store.ts checkpoint and handover durability ordering
54
- run-store.ts cohesive facade over one run's durable mechanisms
55
- run-discovery.ts fail-closed restart discovery
56
- worker-lifecycle-store.ts durable drain/readiness authority
57
- ingress/
58
- index.ts HTTP public surface
59
- errors.ts request errors and HTTP status mapping
60
- service.ts authenticated HTTP, model projection, replay, SSE
61
- validation.ts task/workspace validation and model preflight composition
62
- webhook.ts normalized event validation, hashes, receipts
63
- webhook-router.ts idempotent event-to-worker routing
64
- observability/
65
- index.ts injected facade and construction surface
66
- contract.ts business-facing observability contract
67
- configuration.ts identity, resource, exporter selection
68
- logger.ts bounded redacted JSON stderr logging
69
- safe-fields.ts field allowlist and value bounds
70
- exporters.ts contained exporter wrappers
71
- metrics.ts runtime instruments and bounded state
72
- setup.ts SDK/exporter selection and signal-owner construction
73
- telemetry.ts facade implementation and signal lifecycle
74
- tracing.ts spans, propagation, limits, provider
75
- pi-integration/
76
- index.ts Pi session-policy public surface
77
- diagnostics.ts non-secret installed diagnostics
78
- prompts.ts control, continuation, handover prompts
79
- rollover.ts adaptive arithmetic and durable evidence
80
- durable-host.ts native Harness/conversation lifetime and sanitized events
81
- durable-runtime.ts authenticated Models, registry and SQLite FULL construction
82
- durable-invocation.ts native submission/recovery and finalized-usage steering
83
- durable-admission.ts bounded captured operator IDs for native admission
84
- durable-session-files.ts strict native locators and unique successor discovery
85
- durable-resources.ts operator prompts/skills and untrusted repository instructions
86
- durable-extensions.ts bounded trusted native module loading
87
- durable-tools.ts existing Pi tools registered as native durable tasks
88
- message-text.ts text-only native response projection
89
- execution/
90
- index.ts supplied backend public boundary
91
- contracts.ts one bounded effect/resource port and profile identity
92
- profile.ts actual Linux isolation and mount provenance validation
93
- protocol.ts bounded hostile request/result codecs
94
- docker-backend.ts exclusive namespace lease, live authority and joined cancellation
95
- docker-engine.ts explicit local Unix-socket Engine HTTP/exec control
96
- warm-channel.ts authenticated resident RPC and serial parent operations
97
- hands-entry.ts retained installed Pi body dispatch inside hands
98
- hands-resident.ts resident frames and operation-local effect acknowledgements
99
- hands-processes.ts guarded attachments and exact namespace lifetime
100
- hands-process-owner.ts fixed command UID and bounded descendant joins
101
- hands-native-child.ts minimal native search child streams/events over that owner
102
- hands-selected-inputs.ts opening image/sealed-host checks and exact image aliases
103
- hands-resources.ts protected authorized resource epoch view
104
- native-env.ts minimum native environment with typed unsupported operations
105
- runtime/
106
- index.ts runtime public surface
107
- controller.ts durable cycling and Pi-native cancellation state machine
108
- worker.ts single resident slot, drain, controller ownership
109
- ```
110
-
111
- The dependency direction is:
112
-
113
- ```text
114
- public root / CLI worker -> worker -> ingress -> runtime -> pi-integration -> model-access
115
- CLI direct -----------------> worker capability helpers -> native host/backend
116
- public client -> HTTP -> ingress (no root/CLI/worker import)
117
- public hands -> existing configuration/firewall functions
118
-
119
- composition -> ingress -> runtime -> pi-integration -> model-access
120
- | | | |
121
- +--------+-------------------------+---------------+-> durable
122
- +-------------------------+-----------------> observability contract
123
- ```
124
-
125
- `model-access` is normalization and control around the installed Pi `ModelRuntime`, not another provider layer. Pi owns provider/model discovery, auth, credential storage/refresh, availability, compatible endpoint execution, and model requests. SEPT exposes only approved metadata, reads the atomic credential-free Pod default for every admission, and preflights the final pair before `RunStore.create()`. Direct and webhook tasks use the same admission function and service. Login remains UI-neutral in the service; only the installed CLI supplies an interaction adapter. Plain HTTP exposes authenticated read/selection routes but no secret mutation.
126
-
127
- `durable` has no dependency on higher mechanisms. Existing format-2 manifests with fixed rollover options remain readable and normalize to format 3; all new manifests contain the resolved provider/model and no rollover knobs or credentials. The state-root `worker-state.json` remains authoritative for accepting/draining/drained readiness. Each run's bounded `conversation.jsonl` remains the sole client-facing event contract, separate from internal lifecycle events, logs, Pi sessions, rollover evidence, and checkpoint/handover controls.
128
-
129
- `pi-integration` receives the selected Pi model from the manifest, verifies context/output metadata again, and opens the run's native Durable Harness with SQLite FULL and compaction disabled. Native conversation IDs are numeric; SEPT exposes their string form and bounded versioned locators. `rollover.json` remains scoped to provider, model, conversation identity and context window. Native finalized-response hooks supply usage; a stable steering submission is reused after restart or resumed with a distinct interrupted-handover recovery input. Handover JSON, Markdown, event and state commit before a fresh native conversation and provider UUID are created. Exact captured operator IDs accompany admission, so later queue arrivals cannot be marked in an earlier prompt.
130
-
131
- Trusted agent-directory modules follow Node process/module-URL caching: host replacement and same-process worker stop/reopen do not guarantee edited-code reload; use a fresh Node process. They register native declarative extensions, including supported tools, sections, hooks, wrappers and tasks. Project trust remains false; repository instructions do not execute plugins. The existing Pi tools are adapted into native Durable tasks with explicit replay safety and cancellation. Both their complete existing bodies and the minimum native environment operations use the consumer-supplied `execution` backend. The backend enforces effects separately from brain; Pi remains the scheduler, replay and provider owner. New runs have one engine, with no coding-agent production host or historical transcript converter.
132
-
133
- `runtime` retains execution, cancellation, wait/wake, shutdown, limits, restart adoption, and slot ownership without knowing HTTP. `ingress` translates the authenticated API and webhook contract onto runtime and model-access services. `observability` imports no business mechanisms and receives only bounded classifications/numbers; model identifiers, credentials, auth interactions, prompts, and provider errors are not telemetry fields.
134
-
135
- The architecture suite enforces index-only cross-mechanism imports. `npm run build` cleans `dist`, so deleted or moved modules cannot survive as stale executable output. SEPT does not add ACP, a second agent loop, provider client, tokenizer, compactor, dashboard, cloud service, or model server.
136
-
137
- `worker/worker.ts:createWorker` composes the authenticated service, capability admission and actual post-bind endpoint closure. The installed CLI worker calls that same factory; direct run reuses the extracted capability helpers. Library options are explicit, imports are inert, and the caller owns signals/telemetry shutdown. Ready means listener/router plus synchronous adoption, while native Pi work continues asynchronously and publishes task state. Stop reuses the durable boundary; waiting reopen preserves session and budgets.
138
-
139
- This shared composition binds the single consumer-supplied Docker Linux hands container into the installed callers. Brain retains credentials, Models/Harness and SEPT control state; hands gets namespace aliases, a clean environment and exact bounded read-only resource projections. Missing/unsupported enforcement refuses without a local fallback. The `docker-linux-warm-v1` profile uses the same finite private `/workspace` tmpfs with default file rights and explicitly granted commands. Consumers seed/export it and preserve bytes before stopping. Selected data/code may be baked read-only image trees, with genuinely `FS_IMMUTABLE`-sealed Linux host inputs retained as optional compatibility. Ordinary RO binds and private-domain RW host binds refuse. The file-only `mutable-file-bind` alternative omits command/discovery traversal and image aliases. Completed commands join namespace descendants; normal close retains the consumer-owned idle namespace. Cancellation/loss stops and verifies it before settlement, and unverified cleanup durably blocks instead of publishing cancellation. Projection refresh relies on private bounded ownership receipts; consumer markers grant no deletion authority. See [the profile contract](pi-contract.md#supplied-hands-reference-profile) and [consumer image recipe](pi-contract.md#selected-image-data-and-code).
140
-
141
- The bounded channel carries version/generation/configuration/session/sequence-correlated operation, effect check/ack and command frames. Authentication grants no rights: the live parent rechecks policy, roots, task identity, pins, expiry and cancellation at admission, immediately before effects/command start and at result acceptance. Opening qualifies immutable source/image/kernel facts; live checks retain bounded generation/mount/topology and anchored inode ownership without scanning the workspace on each call. Limits remain 512 KiB request, 4 MiB result and FIFO eight. Ordinary body errors preserve a healthy resident; broken framing/identity/cleanup seals admission and stops the exact generation before truthful settlement.
142
-
143
- ## Capability policy ownership
144
-
145
- `durable/capability-policy.ts` owns the bounded private record, exact codec, fsync and revision CAS; it imports no lifecycle or execution behavior. `cli/permissions.ts` is the local operator writer; `worker/capabilities.ts` owns the shared worker/direct capability composition. `execution/capability-admission.ts` maps validated rights onto the supplied namespace and effective registrations. `DockerExecutionBackend` owns live revision/generation checks, queued/active ownership, policy-change shutdown and run binding reconciliation. `docker-control.ts` owns kernel qualification, bound lifetime receipts and exact-generation stop verification through the explicit `DockerEngineControl` Unix-socket HTTP client; `profile-configuration.ts` decodes trusted configuration while `profile.ts` validates actual kernel containment. `hands-files.ts` supplies complete supported Pi file operation seams within hands, with retained directory descriptors, independent rights and bounded regular single-link inode access.
146
-
147
- `hands-selected-inputs.ts` parses optional `imageSelected` exact `{ alias }` objects, normalizes absence to `[]` and runs opening selected-tree/image qualification from `docker-control.qualifyKernelProfile`. Image aliases use `[A-Za-z0-9_-]{1,64}`; existing host aliases retain `[A-Za-z0-9_-]+`, including longer aliases. All image/RO/RW aliases share the existing eight-unique-alias bound and policy grants. Image roots have no host source/stat/seed path. The C checker retains one descriptor-anchored bounded type/link/device/depth/count/path walk, requiring per-inode immutable flags only for the sealed-host mode. Exact image/read-only-rootfs and live image/generation/mount receipts protect baked roots; equal, ancestor and subtree mounts refuse. Configuration/data/code changes require fresh image where applicable, fresh generation and authority after quiescence. Literal `uid-dac-fixed-helper-v1` in the kernel receipt prevents old authority being silently reused; incompatible history remains intact.
148
-
149
- Policy authority never enters HTTP task/webhook/model input. Nonempty old state without policy remains dormant; malformed present state fails closed. Native Harness still owns scheduling, safe/unsafe replay and task identity; the worker still owns its single slot, drain, exact queues and budgets. Live denial wins before any queued/replayed effect, while already accepted durable inputs remain recoverable. Supported uniform-read policy retains whole native search/resource bodies. Partial-read namespaces omit search/list and workspace resource discovery; they keep independent anchored file tools and trusted global sections. There is no alternate scheduler, policy editor, provisioner or new operation journal.
150
-
151
- `hands-guard.c` is the fixed Linux constructor for trusted entry process protection. The build stage alone compiles its shared library; the runtime image contains the fixed library under its read-only root. `hands-guarded-command.ts` composes the cleared offline environment, fixed preload and disabled SIGUSR1 inspection; a fixed Node prelude verifies version-2 constructor acknowledgement before the resident starts. The resident UID10002 retains imports, private resource epoch and a correlated non-TTY RPC attachment. Commands run UID10003:GID10002 without the brain group; `/app` is UID10002:GID10001 mode 0750 and resident HOME/epoch/MIME captures are private 0700 with files 0600. Root-owned0555 command/rg/fd executables live in `/usr/local/libexec/sept`; private HOME contains matching supplied discovery aliases. The command entry establishes a separate session for the SIGCONT boundary. Fixed command/join helpers retain sole execution/descendant ownership. DAC/nondumpability/guards protect resident bytes, memory, signals, imports and control descriptors. Some public proc metadata and resident command-line correlation remain visible; correlation and command stdout cannot acknowledge or dispatch authority.
152
-
153
- Pi still owns the full grep/find bodies. The image patch adds their optional native spawn callback, bound only during the current admitted operation. `hands-command-authority.ts` reconstructs exact native argv for the matching grep→rg/find→fd parent, requires current READ authority/uniform readability, rejects private roots and supplies network:false without a new helper timer. These children consume no Bash execute grant. Fixed `/tmp` capture-name exclusions remain. `hands-native-child.ts` adapts separate bounded stdout/stderr, kill/error/close and drain behavior to the existing command owner; it is not another scheduler or process owner. Per-stream UTF-8/order survives the transport; Bash alone combines chunks in arrival order. Custom results use only stdout (4096-byte bound), with stderr drained within the shared 4 MiB output budget. Helper loss/overflow/cancellation cannot yield partial normal success; close/settlement waits for exact joins and native limit/abort conventions remain Pi-owned.
154
-
155
- Image delivery uses exactly four assets in `image/pi-native-search`: overlay, patch, provenance and README. Revision `sept-native-search-v1` overlays only `dist/core/tools/{find,grep}.{js,d.ts}` after unchanged locked `npm ci`; host Pi 1.1.0 remains stock, with the exact locked package graph. Docker verifies upstream/overlay and effective bytes before compile, after prune and after final COPY; opening qualification rechecks pinned private provenance and effective installed hashes. The pinned registry archive omits LICENSE; the existing README retains the exact upstream MIT notice and is privately copied with provenance. See [reproduction/provenance](../image/pi-native-search/README.md).
156
-
157
-
158
- `durable/capability-request-codec.ts` validates exact bounded operation/content and decision facts; `capability-requests.ts` persists at most 32 immutable original denials and one matching retry claim through the existing policy lease/atomic helpers. `execution/capability-requests.ts` connects those facts to live run/policy/generation checks; the Docker backend retains effect ownership, expiry timers, cancellation and namespace joins. `cli/permission-decisions.ts` owns local inspection/decision/direct retry only. Native Pi remains the sole task journal/scheduler/provider loop. Pending wait is typed by `permissionRequestId`, published after closure and cleared only by the shared explicit accepted-message wake. Recovery of an interrupted request closes the captured namespace before checkpointing input without dispatching native work. One optional operator-registered hand uses anchored hash-verified code in `execution/custom-hand.ts`, outside the protected entry and brain API.
159
-
160
- The single custom tool pins its operator path/hash/replay in native task memo evidence before execution intent. Recovery requires that original pin to be present and unchanged before effects; replacement code needs a new native task. This memo grants no permission and never resumes a denied original call.
161
-
162
- Custom code must be below an admitted RO image or genuinely sealed host alias and satisfy the existing bounded arbitrary-execution profile. Anchored code is read/hash-checked once (64 KiB maximum), then the exact bytes/input are checked again by the parent and passed to the clean Node child. Native input has text `maxLength: 256` plus a 1024-byte transport bound, optional boolean network intent, stdout-only 4096-byte/64-line native output limits and the existing 5-second timeout. SAFE replay rechecks current pin/authority; UNSAFE interrupted effects retain uncertainty without replay. No native API object or credentials cross into the child.
163
-
164
- Hands networking has two enforced layers: the consumer owns an exact IPv4/IPv6 kernel filter excluding special/metadata and all reachable public/private brain endpoints, and the resident remains socket denied while each actual command installs inherited seccomp socket denial unless explicit policy/exact approval and call intent permit network. Explicit grants include legitimate private/CGNAT/ULA peers and private DNS. Shared protected/gateway resolvers permit only UDP/TCP destination53 with complete nonconflicting protected endpoint facts. SEPT validates current brain interfaces, runtime-derived topology, DNS and actual filter tables before effects through its trusted control client; configuration fingerprints bind the complete portable consumer inventory. It does not provision a namespace or run a network broker. Native Bash/custom schemas preserve bounded network intent in operator request/retry identities; network expansion uses the existing quiescent fresh-generation rule. Credentials and Models remain brain-owned.
165
-
166
- Support is bound to the exact qualified source/image/host combination. Native Windows worker operation remains unsupported because Unix control/POSIX leases remain; Intel Mac and Windows Docker Linux/WSL recipes remain unqualified. [The repository-only historical record at d361123](https://github.com/DB-Conneely/sept/blob/d361123d7c242db5af3ae2d1cb4daea4a2acdeff/docs/as-built/capability-confinement.md) retains source/image evidence and publicIPv6/UFW/provider-outage/OAuth and unknown original stream-loss qualifications.
167
-
168
- The package ships matching source maps/source, canonical docs, notices and all four image assets. Its allowlist excludes tests/audits/private evidence/state/credentials. `prepack` reuses the existing clean/build; it adds no compiler, bootstrap, provider or provisioner. The tarball is not a complete Docker build context. [SDK ownership](sdk.md) and [the documentation index](index.md) are the consumer entry points.
package/docs/index.md DELETED
@@ -1,55 +0,0 @@
1
- # SEPT documentation
2
-
3
- This is the canonical Markdown corpus for people and AI assistants. Read these same files from a checkout, the npm package or a website renderer. There is no separate AI contract.
4
-
5
- ## Version and support
6
-
7
- This corpus describes `sept-agent@0.1.0`, ESM on Node.js >=22.19.0, with installed Pi 1.1.0. Only `sept-agent`, `sept-agent/client` and `sept-agent/hands` are npm APIs; internal source/mechanism barrels are not public entries. CommonJS, browser use and native Windows worker operation are unsupported.
8
-
9
- Execution uses an explicitly supplied local Docker Linux Engine (API 1.44–1.52, cgroup v2) and the matching SEPT image. Installing npm does not compile the C helpers or apply the image-only overlay. Published versioned image tags select Linux AMD64 or ARM64 automatically. On macOS the Node worker runs on the host and Docker Desktop supplies Linux containers. Native Apple Silicon task execution is qualified separately; Intel Mac package install/worker lifecycle checks do not establish task/effect support. Building locally requires a pinned full source checkout; the tarball intentionally excludes the build/test context.
10
-
11
- The prior portability qualification is historical: executable source `3bf4f560e4989005469431c16a67fd911398fa01`, confirmed at docs-only commit `d361123d7c242db5af3ae2d1cb4daea4a2acdeff`. Its [repository-only as-built record](https://github.com/DB-Conneely/sept/blob/d361123d7c242db5af3ae2d1cb4daea4a2acdeff/docs/as-built/capability-confinement.md) records native abyss Ubuntu26.04.1/x86_64, kernel7.0.0-38, Docker29.1.3/cgroup v2 and Node 22.22.1; native Mac ARM qualifies only its scoped Docker Linux path. This does not certify a later package/image. Full Darwin, Intel Mac, Windows/WSL and arbitrary combinations remain unqualified. The [Pi contract qualifications](pi-contract.md#portability-qualification) retain the exact network/provider/security/evidence limits.
12
-
13
- ## Developer reading order
14
-
15
- 1. [README](../README.md): install, worker and client entry points.
16
- 2. [Models](models.md): choose/authenticate a suitable model.
17
- 3. [Pi and supplied hands](pi-contract.md#executable-supplied-hands-setup): supply the execution namespace and first-boot policy.
18
- 4. [SDK](sdk.md): embed the worker and connect an existing service.
19
- 5. [Worker API](worker-api.md): complete HTTP/SSE routes and durable semantics.
20
- 6. [Architecture](architecture.md) and [observability](observability.md): ownership and operational evidence.
21
- 7. [Contributing](../CONTRIBUTING.md): exact setup/gates and change expectations.
22
-
23
- The [Node app](../examples/node-app/README.md) hosts the worker and authors a trusted native extension. The [incident app](../examples/incident-investigator/README.md) integrates inline evidence, WAIT and later operator evidence through the public client. Use separate fresh authority roots for these different grants.
24
-
25
- ## AI task navigation
26
-
27
- | Task | Read and preserve |
28
- | --- | --- |
29
- | Embed/start/stop/reopen a worker | [SDK worker lifecycle](sdk.md#worker-lifecycle); explicit roots/token and caller-owned signals/telemetry |
30
- | Integrate an existing HTTP service | [Five client calls](sdk.md#five-client-calls); stable IDs, ambiguous acceptance and current state |
31
- | Recover a conversation gap | [Finite 410 recovery](sdk.md#finite-410-recovery); report the missing evidence before choosing retained tail |
32
- | Select/authenticate/configure a model | [Models](models.md); immutable pair, Pi-owned credentials and declared usage/context metadata |
33
- | Supply hands or set rights | [Executable setup](pi-contract.md#executable-supplied-hands-setup) and [local permissions](pi-contract.md#local-hands-permissions); no task-text authority |
34
- | Write or port a native extension | [Native authoring](pi-contract.md#author-build-and-load-a-native-extension); normal matching imports and full brain-code trust |
35
- | Use SSE/drain/model routes absent from the client | [HTTP API](worker-api.md); retain all routes and bounds |
36
- | Diagnose state versus telemetry | [Observability ownership](observability.md#library-and-cli-ownership); durable evidence is authority |
37
- | Change source/API/examples | [Contribution rules](../CONTRIBUTING.md) and [architecture](architecture.md); exercise the installed production path |
38
-
39
- ## Website and raw Markdown mapping
40
-
41
- A renderer can map routes directly to these source files. Links remain ordinary Markdown; publication and routing infrastructure are outside this package.
42
-
43
- | Suggested website route | Canonical file in this package |
44
- | --- | --- |
45
- | `/` | [README.md](../README.md) |
46
- | `/docs` | [docs/index.md](index.md) |
47
- | `/docs/sdk` | [docs/sdk.md](sdk.md) |
48
- | `/docs/models` | [docs/models.md](models.md) |
49
- | `/docs/worker-api` | [docs/worker-api.md](worker-api.md) |
50
- | `/docs/pi-contract` | [docs/pi-contract.md](pi-contract.md) |
51
- | `/docs/architecture` | [docs/architecture.md](architecture.md) |
52
- | `/docs/observability` | [docs/observability.md](observability.md) |
53
- | `/contributing` | [CONTRIBUTING.md](../CONTRIBUTING.md) |
54
-
55
- Repository-only rules, audits, specifications and historical as-built evidence are explicitly linked to the repository. Historical claims use pinned revisions. They are not additional files in the npm artifact.
package/docs/models.md DELETED
@@ -1,78 +0,0 @@
1
- # Models and Pi authentication
2
-
3
- SEPT uses the installed Pi **1.1.0 ModelRuntime**. A suitable supported/configured model can run a SEPT task; “any model” does not mean any arbitrary protocol or incomplete model metadata. Pi owns provider discovery, availability, authentication, requests and loaded local-model integrations. SEPT normalizes bounded credential-blind metadata and controls immutable task selection.
4
-
5
- ## Select a model
6
-
7
- All commands below use the same explicit private agent directory as the worker:
8
-
9
- ```sh
10
- sept auth status --provider openai-codex --agent-dir "$PI_CODING_AGENT_DIR"
11
- sept auth login --provider openai-codex --method subscription --agent-dir "$PI_CODING_AGENT_DIR"
12
- sept auth login --provider anthropic --method api-key --agent-dir "$PI_CODING_AGENT_DIR"
13
- sept models list --provider openai-codex --agent-dir "$PI_CODING_AGENT_DIR"
14
- sept models select --provider openai-codex --model gpt-6-sol --agent-dir "$PI_CODING_AGENT_DIR"
15
- sept models current --agent-dir "$PI_CODING_AGENT_DIR"
16
- sept models validate --agent-dir "$PI_CODING_AGENT_DIR"
17
- sept doctor --agent-dir "$PI_CODING_AGENT_DIR"
18
- ```
19
-
20
- Login reads hidden TTY input or stdin, including secrets/manual codes; never put credentials in arguments, tasks, profiles or evidence. `sept auth logout --provider anthropic --agent-dir "$PI_CODING_AGENT_DIR"` delegates to Pi. Pi's `auth.json` retains one credential per provider and owns refresh. Keep agent storage private and outside hands; do not commit it or embed it in an image. CLI defaults use `${PI_CODING_AGENT_DIR:-~/.pi/agent}`; library callers explicitly provide `agentDir`.
21
-
22
- Each direct or HTTP/webhook task resolves:
23
-
24
- 1. Its explicit complete `provider`/`model` pair.
25
- 2. The Pod's freshly reread `sept-model.json` default.
26
- 3. Built-in `openai-codex/gpt-6-sol`, only after Pi validates existence, availability, authentication and metadata.
27
-
28
- The fallback is not a credential/availability promise. The default record is atomic mode0600 and contains only format version/provider/model. Changing it affects later admissions; every accepted run's final pair persists immutably. `thinking` is per task: `off`, `minimal`, `low`, `medium`, `high`, `xhigh` or `max`, default `xhigh`; suitability remains Pi/model-owned.
29
-
30
- ```sh
31
- sept run --task "Review the evidence and state unknowns" --role "Evidence reviewer" \
32
- --provider openai-codex --model gpt-6-sol --thinking xhigh \
33
- --state-dir "$SEPT_STATE_DIR" --agent-dir "$PI_CODING_AGENT_DIR" \
34
- --workspace "$SEPT_WORKSPACE_ROOT" --hands "$SEPT_HANDS_CONFIGURATION"
35
- ```
36
-
37
- For the public client, put `provider`, `model`, `thinking` in `task`. Model preflight precedes durable acceptance; missing credentials or unusable metadata refuse safely. Authenticated HTTP exposes provider/model catalogue, GET selection and PUT selection for future runs; see [all routes](worker-api.md). It deliberately offers no secret-bearing login over plain TCP. Catalogue responses never expose auth values/paths, raw provider objects or headers.
38
-
39
- ## Custom and local endpoints
40
-
41
- Use Pi's `models.json` under the same private agent directory. SEPT accepts at most 1 MiB of configuration and requires each custom model's explicit integer `contextWindow` **4096..10,000,000** and `maxTokens` **1..contextWindow**, with 1..1000 entries per configured model list. The current compatible APIs are `openai-completions`, `openai-responses`, `anthropic-messages` and `google-generative-ai`. Pi remains responsible for endpoint compatibility and model behavior.
42
-
43
- A deliberately keyless local HTTP example, for an already running compatible server:
44
-
45
- ```json
46
- {
47
- "providers": {
48
- "local-evidence": {
49
- "baseUrl": "http://127.0.0.1:8080/v1",
50
- "api": "openai-completions",
51
- "apiKey": "local",
52
- "models": [{
53
- "id": "evidence-model",
54
- "name": "Evidence model",
55
- "reasoning": false,
56
- "input": ["text"],
57
- "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
58
- "contextWindow": 32768,
59
- "maxTokens": 4096
60
- }]
61
- }
62
- }
63
- }
64
- ```
65
-
66
- Use real server-supported IDs/limits; this is configuration shape, not a supplied model/server. Run `sept models validate`, list that provider, then select or explicitly admit its pair. Ollama, LM Studio, vLLM and Pi's loaded llama.cpp integration can be used when the installed Pi provider/API and metadata support them. SEPT performs no serving, downloading or automatic unconfigured-server discovery; model catalogue network refresh is off by default.
67
-
68
- URLs are at most 2048 characters and may not contain userinfo, query or fragment. HTTPS is allowed. Deliberate HTTP is limited to `localhost`, `host.docker.internal`, `::1`, loopback127/8 and private IPv4 `10/8`, `172.16/12`, `192.168/16`. A generic hostname/private DNS name, CGNAT or IPv6 ULA is not automatically admitted for model HTTP. These URL rules differ from [hands network CIDR rights](pi-contract.md#explicit-hands-network). Base URL paths such as `/v1` are supported here; the task client's worker URL is origin-only.
69
-
70
- The exact non-secret plaintext API-key sentinel is **`local`**, only for a keyless deliberate local/private HTTP provider. Other API-key values and sensitive headers require Pi credential storage, environment interpolation such as `${MODEL_API_KEY}`, or an intentional `!credential-command`. Header names are bounded; authorization/API-key/token/secret/password headers always require indirection. Credential strings are1..4096 characters without controls and recognizable plaintext secret material refuses. Treat credential commands as trusted operator code. Non-sensitive literal headers remain allowed. Never log resolved values.
71
-
72
- Reachability is from the **brain process**, where Pi runs: `127.0.0.1` inside a brain container means that container, not the host/hands namespace. Configure a reachable admitted endpoint and credentials there. Granting hands network does not configure model reachability or expose credentials to tools.
73
-
74
- ## Usage, context and recovery
75
-
76
- Pi must provide usable context/output metadata and finalized provider-reported assistant usage. SEPT disables auto-compaction and rotates after a durable handover according to that model's context window and observed same-conversation growth. Cumulative spend never triggers rotation; there is no local tokenizer, character-count or compaction fallback. Missing/zero/regressing finalized usage is not treated as zero; persistent unusable samples stop dispatch safely. [Pi session and rollover](pi-contract.md#session-and-rollover) specifies the exact ownership/order.
77
-
78
- A successful compatible/local or live request does not establish outage tolerance or expiring OAuth/subscription refresh resilience; those remain separately qualified in [support limits](pi-contract.md#portability-qualification).
@@ -1,63 +0,0 @@
1
- # SEPT observability
2
-
3
- SEPT emits operational telemetry without changing its durable recovery or audit records. `manifest.json`, `state.json`, `events.jsonl`, `rollover.json`, operator-message evidence, checkpoints, and handovers remain authoritative and are fsynced in their existing order. Telemetry can be sampled, dropped, unavailable, or retained for a shorter period without affecting execution or recovery.
4
-
5
- ## Library and CLI ownership
6
-
7
- `createWorker({ telemetry })` accepts the public `Observability` interface. The embedding host constructs and owns that implementation and its shutdown; `worker.stop()` joins the worker's durable lifecycle but does not dispose caller-owned telemetry. Omission uses no-op telemetry. Importing `sept-agent` starts no logger/exporter or signal handler and reads no telemetry environment configuration. There is no public telemetry-construction framework in the package API.
8
-
9
- The CLI owns its environment-configured telemetry, process signals and bounded shutdown/flush. Its worker command calls the same factory with that injected facade. Environment examples below apply to the CLI; an embedding application's own telemetry construction controls its behavior. Attempt worker and application-owned telemetry/provider/listener cleanup independently so one failure cannot skip another finalizer. Durable files/events remain the recovery and audit authority even when telemetry fails or is unavailable. See [SDK lifecycle](sdk.md#worker-lifecycle).
10
-
11
- ## Signals and identity
12
-
13
- - **Logs:** bounded-field Pino JSON on stderr for container-runtime collection. The exact Node SQLite experimental notice is retained as a fixed `pi.sqlite.experimental` warning during the one shared driver import; unrelated Node warnings retain their platform behavior. The original warning emitter is restored after import success or failure. The public command result remains on stdout; SEPT creates no repository log files. Logs include `service.name`, `service.version`, `service.instance.id`, `sept.worker.id`, `process.pid`, lifecycle, and active trace/span IDs where available.
14
- - **Traces:** OpenTelemetry spans cover worker startup/adoption, authenticated HTTP routing (including credential-blind model catalogue/selection, drain, cancel, transcript, and stream setup), task/webhook/operator routing, controller and lease ownership, Pi session open/resume/rotation/close, invocations, context/checkpoint/handover events, and terminal outcomes.
15
- - **Metrics:** OpenTelemetry instruments cover worker start/uptime/state, run state/outcomes/current epoch and invocation (including cancelling/cancelled), session opens, Pi invocation count/latency/failure, context pressure, operator queue depth, webhook outcomes, HTTP outcomes, exporter health, and bounded Node memory/CPU/event-loop indicators. Missing provider usage leaves context pressure absent rather than reporting a misleading zero. Adaptive rollover's detailed numeric reserves, confidence class, and decision reason remain bounded durable events; telemetry retains only context pressure and rotation outcome.
16
-
17
- `OTEL_SERVICE_NAME` defaults to `sept`. Set the bounded `SEPT_WORKER_ID` to a stable deployment identity such as `review-worker-1`; it defaults to the container hostname. `service.instance.id` is `<worker-id>:<pid>`, identifying one concrete process incarnation. For cardinality and data safety, SEPT accepts only `service.namespace`, `deployment.environment.name`, `container.name`, and `container.id` from standard `OTEL_RESOURCE_ATTRIBUTES`, with each value capped at 128 characters. A deployment can set bounded labels such as:
18
-
19
- ```text
20
- service.namespace=agent-workers,deployment.environment.name=production,container.name=sept-review-1
21
- ```
22
-
23
- Do not put credentials, customer data, repository paths, run IDs, session IDs, message IDs, or other unbounded values in the accepted resource attributes. SEPT deliberately omits the standard process detector because its command-argument resource field could expose `--token` values or filesystem paths; bounded process PID and runtime metrics are emitted explicitly instead. Run IDs are present only in selected logs and traces for investigation. Metrics intentionally omit run, session, message, event, and path identifiers; all metric attributes use finite outcome/state/kind sets.
24
-
25
- ## OTLP configuration
26
-
27
- OpenTelemetry export is disabled unless an OTLP endpoint is configured or the corresponding exporter is explicitly selected. Pino JSON logging remains enabled unless `SEPT_LOG_LEVEL=silent` is set.
28
-
29
- ```bash
30
- export OTEL_SERVICE_NAME=sept
31
- export SEPT_WORKER_ID=review-worker-1
32
- export OTEL_RESOURCE_ATTRIBUTES='service.namespace=agent-workers,deployment.environment.name=production,container.name=sept-review-1'
33
- export OTEL_EXPORTER_OTLP_ENDPOINT='http://alloy.internal:4318'
34
- export OTEL_EXPORTER_OTLP_PROTOCOL='http/protobuf'
35
- export OTEL_TRACES_EXPORTER=otlp
36
- export OTEL_METRICS_EXPORTER=otlp
37
- ```
38
-
39
- Signal-specific `OTEL_EXPORTER_OTLP_TRACES_ENDPOINT` and `OTEL_EXPORTER_OTLP_METRICS_ENDPOINT` are also supported. SEPT wires OTLP over HTTP/protobuf; gRPC and HTTP/JSON exporter selection are not supported in this tranche. The upstream OTLP HTTP/protobuf exporters honor standard endpoint, header, compression, certificate, and timeout variables. Treat `OTEL_EXPORTER_OTLP_HEADERS` as a secret and inject it at runtime; SEPT never logs it. Set `OTEL_SDK_DISABLED=true`, `OTEL_TRACES_EXPORTER=none`, or `OTEL_METRICS_EXPORTER=none` to disable export.
40
-
41
- SEPT bounds the trace batch queue to 512 spans, batches to 128, limits span attributes/events, limits metric cardinality to 64 series per instrument, and limits metric export batches to 128. These conventional controls are accepted within hard safety bounds:
42
-
43
- - `OTEL_BSP_MAX_QUEUE_SIZE`, `OTEL_BSP_MAX_EXPORT_BATCH_SIZE`, `OTEL_BSP_SCHEDULE_DELAY`, `OTEL_BSP_EXPORT_TIMEOUT`
44
- - `OTEL_METRIC_EXPORT_INTERVAL`, `OTEL_METRIC_EXPORT_TIMEOUT`
45
- - `SEPT_LOG_LEVEL` (`silent`, `fatal`, `error`, `warn`, `info`, `debug`, or `trace`)
46
-
47
- Exports are batched and asynchronous, and the Pino destination has a 1 MiB in-process buffer ceiling. Export exceptions are contained; failure logs contain only the signal and outcome and are rate-limited to one per minute. Span/context instrumentation executes each wrapped SEPT operation exactly once and preserves the operation's original result or failure even if the SDK fails before or after callback entry. Startup, HTTP work, durable writes, checkpointing, wake, drain, cancellation, and conversation delivery never wait for a collector. Shutdown attempts a short bounded flush, starts signal-owner cleanup independently, and still flushes process logs when an SDK or exporter throws synchronously. Process stop, durable worker drain, and targeted run cancellation retain distinct semantics.
48
-
49
- ## Collector topology
50
-
51
- A minimal container deployment needs no telemetry sidecar:
52
-
53
- 1. Each SEPT container sends OTLP/HTTP traces and metrics to a host-level or central OpenTelemetry Collector or Grafana Alloy endpoint.
54
- 2. The container runtime or Alloy tails each container's JSON stderr stream. Preserve the Pino fields rather than reparsing free text.
55
- 3. The collector/Alloy routes traces to Tempo, metrics to a Prometheus-compatible backend, and logs to Loki. Grafana queries all three using `service.name`, `sept.worker.id`, and `service.instance.id`; trace IDs correlate a log with a trace.
56
-
57
- Use TLS and authenticated collector ingress across hosts, bind collector receivers to private networks, and restrict telemetry egress from SEPT containers to the collector. Collector retries and disk queues belong at the collector, not in SEPT. Do not make collector health a SEPT readiness dependency.
58
-
59
- Start with short operational retention (for example 7–14 days for traces/logs and 30 days for aggregated metrics), then adjust from measured incident needs and cost. Apply collector-side sampling to routine health traffic, retain failures and slow invocations, cap log ingestion, and alert on dropped exporter data. Durable run evidence follows the separate state retention/backup policy and should not be shipped as telemetry. In the production image it remains under `/state/runs`, backed by the required persistent `/state` volume; OTLP traces/metrics remain collector-bound.
60
-
61
- ## Data safety
62
-
63
- Instrumentation uses an allowlist of bounded operational fields. Undefined and non-finite fields are dropped; malformed, control-bearing, or oversized string attributes become the finite `unknown` label rather than being exported. Inbound W3C `traceparent` and validated `tracestate` are propagated; no other request headers or baggage are extracted. It does not export bearer credentials or headers, webhook bodies, source/event/message IDs, task or operator text, prompts, assistant text, tool arguments/output, session IDs, session-file paths, workspace/state/agent paths, provider/model identifiers, authentication sources, auth interactions, or error messages/stacks. Exact user and validated assistant conversation evidence remains only in the bounded local `conversation.jsonl` and authenticated replay/stream endpoints. Operational telemetry records route templates, status classes, bounded lifecycle states, and outcomes, but never conversation text, SSE payloads, cancellation request bodies, or cursor/message IDs.