@nexart/mcp-server 0.1.0 → 0.2.0

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 (50) hide show
  1. package/CHANGELOG.md +63 -8
  2. package/CONTRIBUTING.md +7 -5
  3. package/README.md +47 -31
  4. package/SECURITY.md +8 -7
  5. package/THIRD_PARTY_NOTICES.md +2 -2
  6. package/dist/contracts.js +3 -2
  7. package/dist/json-schema.d.ts +9 -0
  8. package/dist/json-schema.js +20 -0
  9. package/dist/lookup/contracts.js +2 -1
  10. package/dist/network/contracts.d.ts +2 -2
  11. package/dist/owner/custody.d.ts +3 -0
  12. package/dist/owner/custody.js +26 -16
  13. package/dist/protocol-safety.d.ts +3 -0
  14. package/dist/protocol-safety.js +16 -0
  15. package/dist/receipts/contracts.d.ts +2 -2
  16. package/dist/receipts/contracts.js +2 -1
  17. package/dist/record/contracts.d.ts +42 -0
  18. package/dist/record/contracts.js +5 -0
  19. package/dist/record/record.d.ts +3 -0
  20. package/dist/record/record.js +6 -2
  21. package/dist/record-tools.d.ts +3 -0
  22. package/dist/record-tools.js +15 -5
  23. package/dist/server.d.ts +11 -1
  24. package/dist/server.js +5 -5
  25. package/dist/stdio.js +3 -19
  26. package/dist/write/attest.d.ts +3 -0
  27. package/dist/write/attest.js +2 -1
  28. package/dist/write/contracts.d.ts +2 -2
  29. package/docs/consumer-guide.md +133 -0
  30. package/package.json +11 -4
  31. package/server.json +2 -2
  32. package/docs/age-version-compatibility.md +0 -46
  33. package/docs/architecture.md +0 -72
  34. package/docs/compatibility.md +0 -163
  35. package/docs/contracts.md +0 -127
  36. package/docs/licensing-review.md +0 -109
  37. package/docs/milestone-1-validation.md +0 -110
  38. package/docs/milestone-2.md +0 -291
  39. package/docs/milestone-3.2.md +0 -291
  40. package/docs/milestone-3.md +0 -274
  41. package/docs/milestone-4a.md +0 -221
  42. package/docs/milestone-4b1.md +0 -220
  43. package/docs/milestone-4b2.md +0 -260
  44. package/docs/public-default.md +0 -263
  45. package/docs/recording-schema-compatibility.md +0 -46
  46. package/docs/release.md +0 -311
  47. package/docs/security-fixes.md +0 -47
  48. package/docs/security.md +0 -195
  49. package/docs/standalone-acceptance.md +0 -81
  50. package/docs/validation.md +0 -85
@@ -1,274 +0,0 @@
1
- # Milestone 3: opt-in AI V2 creation and attestation
2
-
3
- ## Scope and defaults
4
-
5
- Current visibility selection defaults public, while public capability remains
6
- off. See [the public-default update](public-default.md) for recommended owner-only
7
- confidential creation and custody. The MCP sealing contracts below are unchanged:
8
- `from_execution` is ordinary; `from_snapshot` can preserve existing commitments.
9
-
10
- The existing seven read-only tools remain advertised by default. There are no
11
- changes to SDK pins, cryptographic implementations, upstream repositories,
12
- production trust pins, npm privacy or UNLICENSED status. No running web service
13
- or preview is needed.
14
-
15
- Owner settings (exact string `true` enables boolean settings):
16
-
17
- | Variable | Default | Effect |
18
- | --- | --- | --- |
19
- | `NEXART_ENABLE_SEAL` | false | Register local sealing tool |
20
- | `NEXART_ENABLE_ATTEST` | false | Register attestation tool |
21
- | `NEXART_DISCLOSE_CER` | false | Permit full CER output from sealing |
22
- | `NEXART_ENABLE_PUBLIC_ATTEST` | false | Permit public requests to reach owner approval |
23
- | `NEXART_NODE_API_KEY` | absent | Server-owned Node credential; needed only for attestation/approval |
24
- | `NEXART_NODE_ACCOUNT_CONTEXT` | absent | Owner-defined account label bound into public approvals |
25
- | `NEXART_PUBLIC_APPROVAL_DIRECTORY` | absent | Absolute, real, owner-only approval directory |
26
-
27
- Do not put real secrets in checked-in host configuration, tool arguments, test
28
- fixtures, or chat. This milestone does not configure any live credential.
29
- The default tools still need no API key.
30
-
31
- ## Sealing contract
32
-
33
- `nexart_seal_ai_v2` accepts exactly one of:
34
-
35
- ```ts
36
- { mode: "from_execution", execution: CreateSnapshotV2Params, createdAt: string }
37
- { mode: "from_snapshot", snapshot: AiExecutionSnapshotV2, createdAt: string }
38
- ```
39
-
40
- The first mode requires an explicit executionId, timestamp, executionRole and
41
- the SDK parameters object. It calls `createSnapshotV2`, then `sealCerV2`.
42
- The second accepts an SDK-ready ordinary or commitment-bearing V2 snapshot and
43
- calls `sealCerV2` without replacing fields. Both use `verifyCerV2` afterwards.
44
- No commitment generation, salts, openings, random identifiers, execution capture,
45
- identity provider, meta/signals/policy sealing options or file fallback is added.
46
-
47
- All published optional execution parameters are accepted; unknown producer
48
- fields are rejected, never silently discarded by the MCP wrapper. An empty
49
- toolCalls array is rejected (the SDK constructor would otherwise omit it).
50
- SDK schema validation remains authoritative for snapshot/nested values.
51
-
52
- The result reports integrity/hash, confidential presence and declared identity.
53
- `bundle` is null unless the owner enables full CER disclosure. No truncation.
54
- The write input cap is 64 KiB, existing complexity bounds also apply, and the
55
- output cap remains 256 KiB. Failed validation returns bounded constant codes,
56
- not SDK diagnostics containing evidence.
57
-
58
- ## Exact optional identity semantics
59
-
60
- SDK 1.4.0 `AiExecutionIdentity`:
61
-
62
- ```ts
63
- {
64
- provider: string;
65
- sub: string;
66
- assertionHash: string; // SDK requires non-empty sha256: prefix
67
- emailHash?: string; // same SDK prefix check
68
- verified: boolean;
69
- }
70
- ```
71
-
72
- Only these keys are supported. Identity remains optional in both modes.
73
- Both boolean values are preserved: the SDK's interface documentation describes
74
- external app verification, but the actual V2 validator accepts a boolean.
75
- MCP never sets `verified:true`, checks an IdP or upgrades the producer assertion.
76
- The SDK seals identity within snapshot integrity/protected-set coverage.
77
- Sealing/attestation outputs report `producer_declared_not_authenticated`, even
78
- when the producer supplied verified:true. Node API-key auth is not execution
79
- producer authentication.
80
-
81
- Private eligible CERs preserve the SDK-valid identity unchanged. Public identity
82
- is a deliberate readable disclosure, including provider, stable subject,
83
- assertionHash, emailHash and verified. The public profile adds string bounds and
84
- full SHA-256 formatting policy without changing local SDK identity semantics.
85
- Owner approval covers every identity value. Neither a hash nor an opaque
86
- subject is a guarantee against reidentification/correlation.
87
-
88
- ## Attestation contract
89
-
90
- ```ts
91
- {
92
- certificateHash: `sha256:${string}`;
93
- bundle: CerAiExecutionBundleV2;
94
- visibility?: "private" | "public"; // default public, NOT publication permission
95
- }
96
- ```
97
-
98
- The expected hash is independently supplied. Local V2 SDK integrity and the
99
- confidential profile must pass before any Node request. The complete original
100
- CER is JSON-serialized unchanged; visibility is only an explicit
101
- `X-NexArt-Visibility` header. No model-selected URL, headers, negotiation flag,
102
- key, opening, pin or model confirmation is accepted.
103
-
104
- The fixed POST target is `https://node.nexart.io/api/attest`. Redirects are not
105
- followed; cookies are omitted; no POST retries occur. The operation is bounded
106
- by deadline, cancellation, 2 active / 8 queued operations per configured server
107
- write client, and a 64 KiB decoded response limit. Error diagnostic bodies are
108
- discarded. A separate manifest GET verifies the accepted receipt with the
109
- published SDK, after the POST slot has been released.
110
-
111
- The response requires the current AI V2 receipt and envelope shapes, with
112
- cross-checks for certificate hash, protocol, Node runtime, attestation ID, key ID,
113
- attestation time and requested visibility. No Node-supplied URL is followed.
114
- The ordinary top-level attestation object and the signed envelope attestation
115
- have DIFFERENT schemas: the former has certificateHash/bundleType and no kid.
116
- Both current fresh and replay response shapes use these checks.
117
-
118
- The result separates:
119
-
120
- - Submission: not_sent, rejected, node_reported_accepted, outcome_unknown.
121
- - SDK CER integrity and confidential eligibility.
122
- - Opening-free commitment authenticity (not opened plaintext verification).
123
- - Requested and Node-confirmed operational visibility.
124
- - Per-artifact public authorization.
125
- - Receipt signature, hash binding, Node identity, lifecycle and signer trust.
126
- - Producer identity declaration, not independently authenticated identity.
127
- - Independent verification availability, never inferred from signature validity.
128
-
129
- Envelope signature verification is explicitly `not_performed`; the signed CER
130
- receipt is checked. No production key is automatically trusted. Manifest failure
131
- or a bad signature after reported acceptance does not erase persistence.
132
- Neither the visibility response nor public visibility is cryptographic proof.
133
- Public resolver availability is `not_checked` by attestation; existing read-only
134
- lookup tools can check it separately. Private visibility is reported as not
135
- public under the Node's reported policy, not as observed global inaccessibility.
136
-
137
- ## Confidential eligibility and bounded public disclosure
138
-
139
- Both modes require SDK-valid input/output commitment envelopes and the exact
140
- confidential declaration. Optional instruction and decision refs must also be
141
- committed; decision ref categories are excluded. Optional identity and SDK version
142
- are accepted. Other optional snapshot fields, CER metadata, context, summaries,
143
- policy evaluations, model evidence, tool events, arbitrary extensions and
144
- application/workflow/correlation IDs are excluded by a closed allowlist.
145
- Valid richer CERs still work with local verification/sealing; they are rejected
146
- for this initial submission profile, not stripped/resealed.
147
-
148
- Public profile `nexart.mcp.ai-v2.public-disclosure.v1` additionally bounds readable
149
- descriptors, timestamps, identity and hashes, and limits decision refs to 16.
150
- Required descriptors, execution ID/role, parameters, timestamps, hashes,
151
- commitment fields/declarations, protected-set paths and optional identity remain
152
- readable. Human review is mandatory: bounded strings can still be sensitive.
153
-
154
- ### Source evidence for the COMPLETE public surface
155
-
156
- Audited `artnames/nexart-node` source:
157
- `0adbad75bcf24580395713680571fab036f3d01f`.
158
-
159
- | Surface | Source and disclosure |
160
- | --- | --- |
161
- | Bundle projection | `src/server.js:1547-1576`: V2 IO commitments kept; only raw IO removed |
162
- | Public sections | `src/server.js:1663-1918`: identity, proof, verification, context, bundle, canonical, optional timestamp/trust |
163
- | Resolver | `src/server.js:1960-2010`: visibility gate, schema/type/hash, sections, links |
164
- | Canonical certificate | `src/attest.js:146-159`, `src/public-canonical.js`: original CER minus certificateHash/meta/declaration |
165
- | Canonical envelope | `src/signing.js:685-698,749-754,832-882`: snapshot plus present approved bundle fields and five attestation fields |
166
- | Node submission | `src/server.js:2682-2845,2940-3403`: private/public and original AI V2 body |
167
- | Atomic visibility/usage | `src/db.js:798-1103` |
168
-
169
- Canonical payload strings expose the ORIGINAL hash/signature perimeter, not the
170
- cosmetically redacted bundle. Instructions, refs, identity, tools, extensions,
171
- model evidence and context can therefore leak unless rejected or deliberately
172
- approved. CER meta is excluded from its hash but can be returned in the bundle.
173
- Database proof meta is not dumped wholesale: receipt/envelope/signatures and
174
- timestamp information are selected. Node-generated attestation identifiers,
175
- runtime hashes, signing keys, signature data, times, available transparency
176
- anchors and raw RFC3161 tokens are also public. No protected plaintext or
177
- opening is needed for supported opening-free independent verification.
178
-
179
- `tests/node-public-projection.mjs` is a source-backed, synthetic AI V2 projection
180
- harness covering all successful resolver sections and both canonical payloads.
181
- It is NOT an upstream server execution or deployed Node test. Tests explicitly
182
- demonstrate metadata leaks in otherwise valid CERs, then prove policy rejection,
183
- and exercise optional readable identity. Test receipt signatures use ephemeral
184
- synthetic keys; synthetic envelope signature fields make no validity claim.
185
-
186
- ## Owner approval: local command, never an MCP tool
187
-
188
- Public submission requires all of:
189
-
190
- 1. Owner enables attestation AND public certification.
191
- 2. CER passes the bounded confidential/public profile.
192
- 3. Exact one-use approval exists outside model-controlled tool arguments.
193
-
194
- Use a dedicated owner-controlled Linux directory, absolute with no symlink
195
- components, mode 0700 and owned by the server UID. Approval files must be
196
- regular, single-link, mode 0600 and owned by that UID. Do not share the directory
197
- with a model, expose it as an MCP resource or put it in a repository.
198
-
199
- Prepare an eligible public request JSON on the owner's machine, then run:
200
-
201
- ```sh
202
- node /absolute/path/to/dist/approve-public.js /absolute/path/to/request.json
203
- # Or the locally installed node_modules/.bin/nexart-mcp-approve-public command.
204
- ```
205
-
206
- Supply host settings/credentials through the trusted local environment, not
207
- command-line arguments. The command opens `/dev/tty` directly, displays the full
208
- CER and public disclosure warning, and requires typing `PUBLISH <certificateHash>`.
209
- It records an approval only, never submits evidence. stdin, a tool flag, an API
210
- key alone and annotations are NOT approval channels. Without a controlling
211
- terminal or safe directory it fails closed.
212
-
213
- The grant is bound through a local HMAC to the complete serialized payload,
214
- profile version, public visibility, fixed Node destination, owner account label
215
- and API credential (rotation invalidates grants). This HMAC authenticates local
216
- approval records only; it is not NexArt hashing, commitment generation or CER
217
- cryptography. No raw payload or credential is persisted in the grant.
218
- Changes to unhashed meta also invalidate binding.
219
-
220
- Approvals last at most five minutes and are claimed atomically by rename before
221
- POST; concurrency cannot consume one twice. Claimed files are removed even when
222
- invalid or submission fails. No automatic retry can reuse an approval.
223
- After an ambiguous outcome the owner must reconcile before separately approving
224
- another attempt. Object-key serialization order is included; reordering JSON can
225
- invalidate approval without changing the CER hash. This is a safe denial, not a
226
- reason to canonicalize/rewrite evidence.
227
-
228
- ### Trust boundary
229
-
230
- The local OS account, executable, environment, approval directory and controlling
231
- terminal are trusted owner infrastructure. An MCP model can request a public
232
- operation but cannot write configuration/grants or operate that terminal.
233
- If a host also gives the model arbitrary same-UID shell/filesystem access to
234
- these controls, this boundary DOES NOT HOLD: keep public enablement off or use
235
- an independently isolated broker. This mechanism is not OS-user isolation.
236
- Runtime `/dev/tty`/UID/file-mode approval support targets local Linux; unsupported
237
- platforms fail closed while private attestation/local sealing remain available.
238
-
239
- ## Node compatibility and outcome limitations
240
-
241
- Source supports private and public confidential AI V2 with identical CER hashes.
242
- MCP always supplies the header because fresh AI attestations otherwise default
243
- public. Private rows are private within their initial transaction, excluded from
244
- public resolution and external ingest. Public eligible rows can resolve and be
245
- externally ingested. Node visibility is operational, not part of CER hashing.
246
-
247
- Existing conflicting visibility is a 409; this tool does not convert a private
248
- proof to public or bypass ownership through another route. Node quota preflight
249
- can reject an exact replay. Existing-hash replay and transactional quota behavior
250
- belong to Node; no extra retry, alternate route or mutation is attempted here.
251
- Known 4xx rejections are reported without reading their bodies; 5xx, redirects,
252
- disconnects, malformed/mismatched success and interruption after send are
253
- outcome_unknown. A rejected request does not establish that no prior proof
254
- already exists. Node-side TSA/ingest effects are not a distributed transaction.
255
-
256
- Successful public resolver responses may be cached for a year; later hiding
257
- cannot recall copies. Commitments do not conceal readable metadata or remove
258
- dictionary/correlation risk in original hashes. Private is access control, not
259
- zero-knowledge storage. Neither property proves execution truth/completeness.
260
-
261
- ## Validation/readiness
262
-
263
- Use `pnpm run validate:release`. Evidence is retained in ignored
264
- `generated-artifacts/milestone-3/`. All original 114 tests remain; expanded tests
265
- cover SDK identity, both sealing modes, confidential eligibility, source-backed
266
- complete public projections, real owner-command PTYs, one-use approval attacks,
267
- bounded mocked POST/receipt/error outcomes, both MCP protocol revisions and
268
- tarball-installed executables. Python 3 is used ONLY by the test PTY driver;
269
- runtime commands need Node 24 and the declared npm dependencies.
270
-
271
- Private and public implementation readiness are established locally against
272
- synthetic evidence/mocks. Real production attestation, deployed visibility/
273
- resolver behaviour, production key trust and specific desktop-host integration
274
- remain UNVERIFIED. No production evidence or quota is used by these tests.
@@ -1,221 +0,0 @@
1
- # Milestone 4A — automatic certification orchestration
2
-
3
- This release adds a **trusted-application library**, not a new MCP recording
4
- tool, background capture mechanism, service or database. The ordinary MCP
5
- process cannot activate automatic certification merely by receiving a broad
6
- API key. Existing tools, manual public approval and opt-in write gates retain
7
- their contracts. No live submission is authorized by this release.
8
-
9
- ## Actual API
10
-
11
- Import `recordExecution` from `dist/record/record.js`. It accepts one of:
12
-
13
- ```js
14
- { kind: 'execution', execution: sdkCompatibleExecution, createdAt }
15
- { kind: 'cer', bundle: existingConfidentialAiV2Cer }
16
- ```
17
-
18
- Either accepts `certification: { mode: 'node', visibility: 'public' }`.
19
- Omitting certification requests Node/public; `mode: 'local'` explicitly prevents
20
- submission and cannot be combined with visibility. Explicit private Node
21
- certification is supported. There is no fallback to another mode or visibility.
22
- An ordinary existing CER is not resealed; this new workflow requires authentic
23
- confidential AI V2. Ordinary `nexart_seal_ai_v2` remains available unchanged.
24
-
25
- Trusted runtime configuration is the second, application-only argument:
26
-
27
- ```js
28
- {
29
- custodyDirectory: '/owner-controlled/existing-0700-vault',
30
- recoveryStorage: 'unencrypted_owner_approved',
31
- captureSource: 'producer_supplied', // default; or instrumented_provider_call
32
- publish: ownerPublisher.publish
33
- }
34
- ```
35
-
36
- None of these configuration fields is accepted in recording input. No API key,
37
- policy path, endpoint, approval token or arbitrary custody path is model input.
38
- The library does not discover Node credentials from environment variables.
39
-
40
- `createIsolatedOwnerPublisher(options)` in `dist/owner/publisher.js` returns
41
- `publish(preparedRecord)` and `reconcile(certificateHash)`. Its owner-only options
42
- are `policyFile`, `stateDirectory`, `approvalDirectory`, `accountContext`,
43
- `credentialContext`, and a `credential()` provider that remains in the owner
44
- process. Both operations enforce the retained isolated-Mac host check first,
45
- before loading a credential. No new CLI, environment override or bypass exists.
46
-
47
- The policy/transport core `publishForTrustedApplication` is an internal embedding
48
- port for an application whose independent security boundary is established by
49
- its operator; it has no automatic host-discovery claim. It is not registered
50
- with MCP. Direct module access is not an OS security boundary. Never import it
51
- into an agent-controlled process together with unrestricted credentials.
52
-
53
- ### Deployment limitations
54
-
55
- Milestone 4A does not solve arbitrary same-UID shell access. An agent able to
56
- control the publisher's account can read/replace policy and state, invoke
57
- library functions, steal available credentials and bypass adapter controls.
58
- Use an independently secured application, isolated account or separate owner
59
- device. Exclude agent logins, terminal/desktop control, shared writable
60
- executables/dependencies, credential access and privilege escalation.
61
-
62
- The packaged owner factory deliberately reuses the conservative existing
63
- root-controlled macOS installation/policy/runtime checks. A normal home-directory
64
- installation with user-managed Homebrew Node still fails. Root control is
65
- defense in depth, not proof of agent exclusion: the administrator's exclusion
66
- policy is an external prerequisite. The current Linux host cannot enable this
67
- factory and no actual Mac factory success is claimed. A less restrictive
68
- cross-platform deployment adapter is deferred, not implemented by a flag.
69
-
70
- ## Confidential creation and custody
71
-
72
- Raw records use the existing owner workflow and pinned SDK. Input/output are
73
- committed; present instructions and decision references are protected by
74
- default. SDK random salts are never supplied by the caller. Recovery material
75
- is fsynced before CER export; partial files are retained on failure.
76
-
77
- The result never returns plaintext, salts, openings or a full CER. It returns
78
- the certificate hash and separate state fields. Existing sealed CERs are
79
- verified without resealing or claiming that this process holds their openings.
80
-
81
- Recovery files contain **unencrypted plaintext and salts**. Mode 0600 and a 0700
82
- vault are not encryption or same-UID isolation. The owner must approve that
83
- storage explicitly and independently provide acceptable disk encryption,
84
- backup and recovery arrangements. No production-secure encrypted vault is
85
- claimed by this milestone. SDK/provider instrumentation and broader custody
86
- backends are not implemented.
87
-
88
- ## Owner-policy contract
89
-
90
- Policy is a strict owner-only JSON file, regular/single-link mode 0600, inside
91
- an approved 0700 directory. Missing/malformed/unreadable policy makes zero POSTs.
92
- Fields:
93
-
94
- | Field | Rule |
95
- |---|---|
96
- | `version`, `id`, `revision` | Schema version 1, bounded label, positive integer revision |
97
- | `accountContext`, `credentialContext` | Owner-bound labels; not proof of Node account identity |
98
- | `credentialFingerprint` | SHA-256 fingerprint of the selected high-entropy credential; never the credential itself |
99
- | `destination` | Exactly `https://node.nexart.io/api/attest` |
100
- | `evidenceTypes` | Only `cer.ai.execution.v2` in this milestone |
101
- | `captureSources` | Explicit producer-supplied and/or instrumented-provider source permission |
102
- | `visibilities` | Explicit public/private permissions |
103
- | `requiredConfidentialFields` | Must include input/output; may require instruction and decisionRefs |
104
- | `readableFields` | Exact JSON-pointer leaf paths, no wildcard; every CER leaf must be allowlisted |
105
- | `identityDisclosure` | Default `forbid`; optional `declared_allowlisted` still requires leaf allowlisting |
106
- | `nodeDisclosureProfile` | Exactly `ai-v2-resolver-reviewed-2026-11` |
107
- | `maximumCertifications` | Positive limit, at most 1,000,000, for this publisher/policy period |
108
- | `periodStartsAt`, `periodEndsAt`, `expiresAt` | ISO UTC times; valid fixed period, expiry no later than period end |
109
- | `revoked` | Must be false to submit |
110
-
111
- The SDK confidential profile and existing public disclosure profile remain
112
- mandatory. The allowlist can narrow them, not broaden them. A readable path
113
- authorizes its values: this is not a semantic PII detector or a guarantee
114
- against covert channels in free text. Identity remains producer-declared.
115
-
116
- The Node disclosure-profile identifier records the reviewed synthetic/source
117
- contract, not a cryptographically pinned deployed implementation. Owners must
118
- review Node-generated public fields, canonical payloads, receipts and timestamp
119
- metadata; changed upstream disclosure semantics require renewed policy review.
120
-
121
- Policy is read on every transaction, rechecked after reservation, and checked
122
- again immediately before the existing HTTP adapter. Changed bytes, revocation
123
- or expiry block the send. Already-dispatched requests cannot be recalled.
124
- Immediate cross-host revocation requires Node enforcement.
125
-
126
- ## Authorization and submission
127
-
128
- The exact original CER is serialized and frozen. No projection, resealing,
129
- canonicalization or hashing implementation is added. Control-plane SHA-256
130
- digests identify policy, credentials and ledger records only, not CER integrity.
131
-
132
- A policy-authorized public transaction issues an internal five-minute,
133
- exact-body grant through the existing approval implementation, then invokes
134
- the existing attestation function. It consumes the grant using the same
135
- credential/account/destination/profile/public-visibility binding as manual
136
- approval. This is prior owner policy authorization, not a simulated TTY prompt.
137
- Unused internal grants are consumed on cleanup. Existing manual approvals
138
- remain separate and unchanged.
139
-
140
- Private submissions also require policy and budget in this workflow; they
141
- cannot bypass the publisher by changing the requested visibility.
142
-
143
- ## Attempt durability and local budgets
144
-
145
- Use a dedicated existing 0700 `stateDirectory`, outside the installation.
146
- An exclusive directory lock serializes reservations across processes.
147
- Each attempt is an exclusive 0600 file containing exact CER bytes, hash,
148
- visibility, source, account, policy ID/revision/digest and reservation time.
149
- File and parent directory are fsynced **before** grant issuance or POST.
150
-
151
- Every reserved attempt consumes one local allowance, including rejected,
152
- cancelled, interrupted, ambiguous or policy-changed attempts. No automatic
153
- refund, POST retry, lock breaking or marker deletion occurs. A stale lock,
154
- malformed ledger or failed fsync fails closed and requires owner inspection.
155
-
156
- The filename binds account and certificate hash across policy revisions and
157
- periods within this state directory. Budget counting binds account/policy ID
158
- and approved period, independent of revision. Changing only revision does not
159
- reset budget. Explicitly approving a new policy ID/period is a new allocation.
160
- Outcome files are separate exclusive records; attempt markers are never
161
- overwritten. Existing markers force reconciliation, not another send.
162
-
163
- This is **publisher-local**, not account-wide Node quota enforcement.
164
- Multiple state roots, devices, other credentials or writers are not covered.
165
- The operator must exclusively allocate this local budget. Node-side scopes,
166
- atomic account quotas and authoritative usage are upstream requirements for
167
- general agent-held credentials or shared-account limits. No credential scopes,
168
- hard Node limits or remote budget checks are invented here.
169
-
170
- `reconcile(hash)` performs an owner-credentialed fixed-origin exact-hash GET,
171
- bounded response parsing, original-CER/visibility matching, SDK verification
172
- and existing receipt verification. It never sends, restores allowance or
173
- removes state. A missing proof remains unresolved, never permission to retry.
174
- Raw proof/account metadata is not returned or retained. Successful readback
175
- records are exclusive; repeat reconciliation cannot overwrite evidence.
176
-
177
- ## Separate result states
178
-
179
- `recordExecution` reports `captureProvenance`, `evidence`, `custody`,
180
- `localIntegrity`, `certificationIntent`, `policyAuthorization`, `submission`,
181
- `requestedVisibility`, `nodeConfirmedVisibility`, `certificateHash`,
182
- `receiptSignature`, `hashBinding`, `signerTrust`, `reasonCode` and `usage`.
183
- There is no ambiguous verified Boolean. Usage explicitly has
184
- `authoritative: false`, `accountRemaining: null`, and `scope: 'publisher_local'`.
185
-
186
- Evidence can be valid and durably sealed while Node setup is missing or
187
- submission is rejected/unknown. Certification intent remains Node.
188
- A valid receipt does not establish signer trust; production pins remain empty.
189
- An invalid signature is reported independently and may reject signer trust
190
- despite Node-reported persistence.
191
-
192
- ## Fixture C and validation
193
-
194
- Fixture C's persisted structural disclosure projection uses an explicit,
195
- non-cryptographic synthetic signature placeholder, not random test signatures.
196
- The certificate hash is unchanged. Receipt cryptographic tests retain their
197
- real ephemeral keys. Exact-file matching remains strict; existing mismatches,
198
- symlinks and unsafe files are rejected. Offline approval result records may be
199
- reused only when byte-identical. Attempt-state writes remain exclusive.
200
-
201
- Validation:
202
-
203
- ```sh
204
- pnpm run build
205
- node --test --test-concurrency=1 tests/orchestration.test.mjs
206
- node tests/validation/run.mjs --milestone-4a
207
- ```
208
-
209
- The isolated validator preserves the frozen 338-test archive and category
210
- counts, runs all tests, packs a new archive, installs it into an independent
211
- consumer, imports orchestration, checks fail-closed behavior and exercises
212
- both supported MCP revisions and existing owner CLIs.
213
-
214
- ## Before later exposure
215
-
216
- No `nexart_record_execution` MCP tool or instrumented SDK integration is exposed.
217
- Before either is added: establish and validate the actual trusted application
218
- or owner-host deployment; approve custody and disclosure; provision owner
219
- policy/account allocation; confirm actual Node behavior and limitations; and
220
- perform separately authorized controlled acceptance. No Milestone 4B/4C work,
221
- Node/SDK changes, live submissions, publishing or licensing change is included.