Governed Execution Source Ledger
Rule-by-rule sources for the Governed Execution docs: which Node 0.30.1 source file, executable test or SDK 0.4.2 declaration grounds each documented contract statement.
Source priority
- Node production implementation.
- Executable Node tests.
- Governed SDK 0.4.2 package contract.
- Current schemas and release documentation.
- Historical documents, non-normative background only.
Sources
| ID | Path | Function, schema or test | Kind |
|---|---|---|---|
| S1 | src/server.js | POST /api/attest handler, cerLogicalExecutionId, cerSignedProtocolVersion, tryBuildIdempotentReplay | Production |
| S2 | src/auth.js | createAuthMiddleware: Bearer validation, fail-closed DB policy | Production |
| S3 | src/attest.js | canonicalize bridge; verifyGovernedExecBundle | Production |
| S4 | @nexart/governed-execution@0.4.2 dist/index.d.ts, dist/index.mjs | CER types, profile, GraphTopology, status and code types, limits | SDK |
| S5 | src/json-body-limit.js, src/sanitize.js, src/request-guards.js | Body limits, JSON structure limits, error middleware | Production |
| S6 | src/signing.js | selectSigningKey, key lifecycle, buildReceipt, signReceipt, getPublicKeyInfo | Production |
| S7 | src/signing.js | Signed-field constants, family optional fields, deriveSignablePayload, buildVerificationEnvelopeV2, signVerificationEnvelopeV2 | Production |
| S8 | src/attest.js; @nexart/ai-execution dist/index.mjs | toCanonicalJson canonicalizer; anchor and timestamp helpers | Production / SDK |
| S9 | src/server.js | governedVerificationMetadata, buildVerifyChecks, /v1/cer/verify response, verifyEnvelopeSignatureMultiKey | Production |
| S10 | Node TSA modules | RFC 3161 timestamp preparation and receipt timestamp fields | Production |
| S11 | src/server.js | verificationUrl construction | Production |
| S12 | Node DB helpers | insertCerProofWithUsage, cer_proofs persistence | Production |
| S13 | Node migrations | cer_proofs columns and visibility_state | Production |
| S14-S16 | Public read routes | /v1/cer/public, /api/public-cer-proof, /v1/resolve/cer/:certificateHash, buildPublicCerSections | Production |
| S17 | Proof management routes | POST /api/proofs/:certificateHash/unhide and /visibility | Production |
| S18 | Ingest client | External ingest skipped for governed CERs | Production |
| S19 | Rate limiter registration | Public limiter; no authenticated limiter on /api/attest | Production |
| S20 | src/server.js | /v1/cage/bundles, /api/stamp, /api/stamp-from-execution | Production |
| T1 | Governed HTTP tests | Happy path, replay, signatures, projection, visibility, unhide | Executable tests |
| T2 | Governed fixtures and negative tests | governed-static-mutual-cycle.json, malformed stateHash | Executable tests |
Each source and rule has a permanent link: #s1 to #t2 for sources, #r1 onward for rules. New rules are added at the end so existing links do not change. Paths are repository-relative to the audited Node source unless a package is named.
Rules
| ID | Documented rule | Page | Sources |
|---|---|---|---|
| R1 | /api/attest body is the complete sealed CER, not { bundle }; Bearer key required | attestation-contract#request | S1, S2, T1 |
| R2 | /v1/cer/verify body is { bundle: CER }; no API key | attestation-contract#stateless | S9 |
| R3 | CER version is "0.1" or "0.2"; protocolVersion mirrors it | attestation-contract#request | S1, S3, S4, T1 |
| R4 | Logical execution identity is evidence.bundle.bundleId | attestation-contract#request | S1, T1 |
| R5 | X-NexArt-Visibility accepts only public | private; default hidden | attestation-contract#request | S1 |
| R6 | X-NexArt-Readable-Fields rejected with READABLE_FIELDS_UNSUPPORTED | attestation-contract#request | S1 |
| R7 | Body, structure, SDK and CAGE limits (source defaults) | attestation-contract#limits | S4, S5, S19 |
| R8 | Success response fields and absent fields | attestation-contract#response | S1, S6-S9 |
| R9 | attestation.checks is ["governed_execution"] | attestation-contract#response | S1 |
| R10 | Optional RFC 3161 timestamp fields; token outside signed perimeters | attestation-contract#response | S10 |
| R11 | Exact replay returns X-Idempotent-Replay: true; mutation returns 409 | attestation-contract#replay | S1, T1 |
| R12 | Failure status table | attestation-contract#failures | S1, S2, S5, S12 |
| R13 | Receipt fields; whole receipt signed; base64url Ed25519 over UTF-8 JCS | attestation-contract#receipt-signature | S6, S8, T1 |
| R14 | Select key by receipt.attestorKeyId, not keys[0] or activeKid | attestation-contract#receipt-signature | S6, T1 |
| R15 | Envelope v2 descriptor fields and values | attestation-contract#envelope-signature | S7 |
| R16 | Envelope signs JCS({ attestation, bundle }) projection, not the descriptor | attestation-contract#envelope-signature | S7, T1 |
| R17 | v0.1 optional: context, contextSummary; v0.2 optional: identity, confidentiality | attestation-contract#envelope-signature | S7, T1 |
| R18 | Node-side envelope check reads bundle.meta.verificationEnvelope* | attestation-contract#envelope-signature | S9, T1 |
| R19 | governedVerification has exactly nine keys; fixed not-performed / not-claimed | attestation-contract#governed-verification | S4, S9, T1 |
| R20 | SDK reason codes and Node INVALID_STRUCTURE | attestation-contract#governed-verification | S3, S4, S9 |
| R21 | /v1/cer/verify returns 200 for verified and failed; computedCertificateHash null on failure | attestation-contract#stateless | S9, T2 |
| R22 | status combines envelope signature; classification may differ | attestation-contract#stateless | S9 |
| R23 | Persisted in cer_proofs, default hidden, no external ingest for governed | attestation-contract#persistence | S1, S12, S13, S18 |
| R24 | Owner visibility routes: POST /api/proofs/:certificateHash/unhide and /visibility; authenticated owner only | attestation-contract#persistence | S17, T1 |
| R25 | Visibility values: header public | private; stored visibility_state hidden | public | private | attestation-contract#request | S1, S13 |
| R26 | Visibility is row state outside the protected hash projection | attestation-contract#persistence | S4 (protectedFields), S13 |
| R27 | Visibility transition preserves certificateHash and CER; no new receipt or signature | attestation-contract#persistence | S17, T1 |
| R28 | verify.nexart.io resolution after a visibility change: NOT established | attestation-contract#persistence | Outside audited repository (limitation 2) |
| R29 | No governed public-reseal route | attestation-contract#persistence | S20, T1 |
| R30 | verificationUrl is formatted, not a publication check | attestation-contract#persistence | S11 |
| R31 | Route status table | attestation-contract#routes | S1, S9, S14-S20 |
| R32 | Discovery response fields and key lifecycle | attestation-contract#discovery | S6 |
| R33 | certificateHash = sha256 over JCS of the protected projection | schema#hash | S3, S4 |
| R34 | Static topology may be cyclic; concrete lineage must be acyclic | topology | S4, T2 |
| R35 | stateHash is opaque; stateHashAlg/Canon/Scope are optional CAGE producer conventions | state-commitments | S4 (absent from SDK schema) |
| R36 | CAGE 19/19 over-the-wire result | cage#interop | Reported by the CAGE project; not part of the source audit |
Runtime evidence
Production interoperability validation reported by the CAGE project: 19/19 over-the-wire checks passed against NexArt Node 0.30.1 and @nexart/governed-execution 0.4.2. See CAGE Integration for what this does and does not establish.