AI Initiative logoAI Initiative
Reading room / Manthan

HERALD v0.2 — Integration notes

HERALD v0.2 — Integration notes. Covers What landed where; `lib/cbor-det/` — CBOR-deterministic profile (T-002, worker-E); `lib/herald-core-ts/` — TypeScript reference library; `lib/herald-ct-log/` — HERALD CT log.

Protocol draft / threat or integration design
This is the retained source text, not a new validation of its claims. Numerical results and comparative claims require the accompanying source review before public reuse.

Read the connected case study or article →

Not explicitly stated in source · 2026-05-05

Provenance, authorship and editorial notes

HERALD v0.2 — Integration notes

Id

manthan-herald-protocol-integration-notes

Project

Manthan

Source path

manthan/herald-protocol/INTEGRATION-NOTES.md

Source sha256

65aa11bb3cce2fd0c08dc164f84e30def38f5c4c30c56aa43b12fe369318e162

Local copy sha256

65aa11bb3cce2fd0c08dc164f84e30def38f5c4c30c56aa43b12fe369318e162

Repo head

3a94084024a3434cef331fecac91c2c3b43f0313

Date

2026-05-05

Date basis

Explicit document metadata

Author

Not explicitly stated in source

Author basis

Unknown; Git committer not substituted for document author.

Last source commit

8b75d1b0157c20a0a463f0e31008ef9f73099beb

Last source commit date

2026-06-08T07:40:14Z

Document status

Protocol draft / threat or integration design

Summary

HERALD v0.2 — Integration notes. Covers What landed where; `lib/cbor-det/` — CBOR-deterministic profile (T-002, worker-E); `lib/herald-core-ts/` — TypeScript reference library; `lib/herald-ct-log/` — HERALD CT log.

Topics
  • Protocol and verification
  • What landed where
  • `lib/cbor-det/` — CBOR-deterministic profile (T-002, worker-E)
  • `lib/herald-core-ts/` — TypeScript reference library
Theme

Protocol and verification

Priority

deep

Related ids
  • manthan-herald-protocol-spec
  • manthan-herald-protocol-threats
Evidence concerns
  • Recovered source text is preserved verbatim. Assertions, comparisons, commands and results belong to its original context; they were not re-executed or externally re-verified during this corpus review.
Word count

2060

Bytes

15564

Source relative

herald-protocol/INTEGRATION-NOTES.md

Remote mirror

manthan/herald-protocol/INTEGRATION-NOTES.md

Full text preserved

True

HERALD v0.2 — Integration notes

Date: 2026-05-05.
Scope: post-collation reconciliation pass. Merging 71 cohort-1 findings into the canonical project tree.

This document records what was integrated, what was not integrated and why, what conflicts remain, and what verification work is outstanding.


What landed where

lib/cbor-det/ — CBOR-deterministic profile (T-002, worker-E)

lib/herald-core-ts/ — TypeScript reference library

lib/herald-ct-log/ — HERALD CT log

lib/herald-core-py/ — Python reference library (T-004, codex-wave3)

demo/conduit/ — pass-through HTTP conduit (T-008)

demo/audit-log/ — flat-file audit log (T-009, worker-glossary)

demo/cli/ — herald verify CLI (T-010)

tests/conformance/ — conformance harness

tests/renderer-conformance/ (T-023, codex-par)

registries/ — canonical normative registries

FileSource
standard-attestations.mdT-012 worker-B
cultural-attestations.mdT-013 worker-C
reserved-sigils.mdT-016 worker-D
refusal-reasons.mdD-310 driver-claude
diversity-policies.mdR-204 worker-glossary
capabilities.mdT-112 codex-20260505

templates/

FileSource
Herald-Charter.mdR-203 driver-claude
LOTS.mdT-106 driver-claude

research/ — design notes (non-normative)

13 files from R-201 through R-216. See COLLATION.md §research for the index.

audits/ — analyses, post-mortems, reconciliations

16 files. See COLLATION.md §audits.

docs/

FileSource
envelope-cheatsheet.mdT-018 codex
verifier-codes.md(cohort-0)
ui-aesthetic-rendering.mdT-025 worker-opus
feedback-intake.mdD-305 codex-feedback-intake

tools/

FileSource
threats-citation-patch.pyD-306 driver-claude
glossary-check.pyT-019 worker-glossary

Integration decisions

Decision 1: T-003 wins for shared base files

Each downstream worker (T-005 through T-119) built their own self-contained package because they could not see T-003's output. As a result every package has its own cbor.ts, crypto.ts, envelope.ts. The unified lib/herald-core-ts/ keeps T-003's versions only. Each downstream worker's contribution was just one new file (<thing>.ts); only that file plus its test is pulled into the unified package.

Risk: if a downstream worker added a required helper to their crypto.ts (e.g. T-007 added a domain-separation enum), that helper is lost and the corresponding <thing>.ts may not compile. This is a known integration gap — see "Verification work outstanding" below.

Decision 2: T-102 wins for shared base files in lib/herald-ct-log/

Same logic: T-103, T-104, T-105 each built their own copy of the CT-log base. Unified package keeps T-102's cbor.ts, crypto.ts, merkle.ts, log.ts, index.ts and pulls only sth.ts / sip.ts / consistency.ts deltas with their tests.

Decision 3: Tests merged sibling-by-sibling

Each <thing>.test.ts lives next to T-003's envelope.test.ts in lib/herald-core-ts/test/. No merge of test runners was attempted; whatever T-003's package.json specifies as the test command will run all of them as a flat directory.

Decision 4: Don't strip RECEIPTs from inside delta-pulled packages

The whole-copy packages (T-002, T-003, T-008, T-009, T-010, T-017, T-102) had their RECEIPT.md and NOTES.md stripped at the package root. The delta-pulled tasks (T-005..T-119) only contributed individual <thing>.ts files; their RECEIPTs remain in manthan/state/findings/.

Decision 5: INTERPRETATION.md files renamed not stripped

Where a base package shipped an INTERPRETATION.md (T-003, T-004, T-017), the file was renamed to INTERPRETATION-T003.md etc. so it's discoverable but not confused with new INTERPRETATION docs that future tasks may produce.


Verification: post-integration tsc pass

After the structural merge, ran tsc --noEmit against lib/herald-core-ts/ with @types/node, @hpke/core, and a basic tsconfig. Initial output was ~60 errors. After fixing integration-class issues (broken cross-task import paths, missing barrel re-exports, Cbor type duplication, lib: ["dom"] for Web Crypto types), errors dropped to 8 real worker-level type bugs.

D-330 — herald-core-ts compile reconciliation (CLOSED 2026-05-05)

All 8 worker-level type bugs fixed:

FileLineIssueWorkerFix
src/discovery.ts117URL null vs undefined mismatchT-113herald_charter ?? undefined coalesces null at the boundary
src/multisig.ts43Dead-code scope comparison (type excludes "origin")T-109Cast input.scope to wider SignatureScope for the defensive runtime check; comment explains why
src/scope.ts143'by' on never (over-aggressive type predicate)T-110Removed the signature is … predicate; left as plain boolean so the false branch keeps its full Signature type
src/scope.ts152Map | Record indexer ambiguityT-110Cast Record path to Record<string, …> after the instanceof Map check
src/trace.ts87Same Map-vs-Record indexer issueT-005Same cast pattern
src/whisper.ts317SharedArrayBuffer not assignable to ArrayBuffer (WebCrypto)T-114Copy into a fresh Uint8Array; pass .buffer (always ArrayBuffer) to importKey
test/duress.test.ts276, 304Cbor type assignmentT-119Replaced cast through {[k: string]: unknown} with cast through Cbor; added import type { Cbor }

Final verification

$ ./node_modules/.bin/tsc --noEmit
(no output — clean)

$ npm test
ℹ tests 133  pass 133  fail 0
ℹ duration_ms 486.7

$ cd ../../tests/conformance && node --experimental-strip-types src/runner.ts
[envelope-core]  6 pass / 0 fail / 1 skip / 7 total
TOTAL: 6 pass / 0 fail / 1 skip / 7 vectors

lib/herald-core-ts/ now compiles clean, 133 unit tests pass, T-001 vector conformance unchanged at 6/7 (the 1 skip is the SPEC §6 rejected-lineage-cycle verdict gap closed by D-319, separate task).

Reproduce the verification:

cd lib/herald-core-ts
npm install
npx tsc --noEmit && npm test

Verification work outstanding

V1. Does lib/herald-core-ts/ compile? — 8 worker-level bugs remain (above)

Open question. Each downstream worker's <thing>.ts was written assuming their version of crypto.ts / envelope.ts. The unified package uses T-003's. Likely failure modes:

Action: run npm install && npx tsc --noEmit from lib/herald-core-ts/ and triage the resulting errors. Most fixes will be small (rename imports, add re-exports). Some will be substantive (a worker's <thing>.ts may need real adaptation to T-003's API). This is a separate task — call it D-330 — herald-core-ts compile reconciliation (~1–3 hours).

V2. Does lib/herald-ct-log/ compile?

Same risk as V1. T-103/T-104/T-105 built against T-102's base; structurally low-risk because T-102 was the declared dependency. But verification still needed.

Action: npx tsc --noEmit from lib/herald-ct-log/. Surface as D-331.

V3. Does lib/herald-core-py/ work?

T-004 was the late comer (codex-wave3). It built against T-003's TS interface. Verification: run python -m pytest from lib/herald-core-py/ and confirm round-trip with test-vectors/v0.2/vectors.json.

Action: D-332.

V4. Tests pass?

Once V1–V3 compile cleanly, run all test suites:

Action: D-333 — full conformance run.

V5. Cross-package interop

Per T-004's brief, the Python lib must produce byte-identical output to the TS lib for the same inputs. Cross-package interop test is its own integration step.

Action: D-334 — cross-package interop test.


What was NOT integrated, and why

Pending tasks (12)

Per manthan/bin/status at integration time: T-011 (two-agent demo end-to-end), T-107 (molt handler — depends on T-104), T-108 (disputed-state — depends on T-107), T-115 (reference Herald — depends on T-102 + T-106), T-116 (Bestiary — depends on T-102), T-117 (inheritance gating — depends on T-102 + T-107), T-120 (MCP wrapper), T-121 (LangChain middleware), T-122 (The Crier service), T-123 (The Mortician service), T-124 (The Scribe service). Plus the V1–V5 verification tasks above are not yet TODO rows.

Most of these are downstream of completed work; they can be picked up by cohort-2 once the verification pass closes.

Receipts and NOTES files

Every finding has a RECEIPT.md and (often) a NOTES.md. These remained in manthan/state/findings/T-NNN/ rather than being copied into the production tree. Rationale:

1. They're worker journals, not deliverables.
2. They contain manthan-internal claims and audit trails that aren't useful in the production tree.
3. Keeping them in manthan/state/findings/ preserves provenance (who built what, when, with what surprises) without polluting production directories.

A future archival task could batch-collate them into a manthan/journals/ directory, but that's curation, not integration.

Per-package node_modules/

Stripped via rsync --exclude=node_modules. Each package will need its own npm install before testing.

Per-package package-lock.json

Stripped from demo/conduit/ (where it was 11K lines and dwarfed the actual ~50-LoC code). Lockfiles can be regenerated.

INTERPRETATION.md from delta-only tasks

Each downstream worker who only contributed one delta file may have shipped an INTERPRETATION.md describing their local decisions. These remain in manthan/state/findings/T-NNN/ and are discoverable but not pulled into production.

Conflicting copies of shared modules

Per Decision 1 above. Each worker's copy of cbor.ts, crypto.ts, envelope.ts, etc. remains in manthan/state/findings/T-NNN/src/. If V1 reconciliation reveals that a specific worker's helper was load-bearing, the integration pass can pull that helper from their src/ copy.


Suggested next steps

1. Run V1 (tsc --noEmit on lib/herald-core-ts/). Fastest signal on whether the decision-1 strategy held.
2. Triage the resulting type errors. Most will be import paths or missing re-exports; a few may need real reconciliation.
3. Run V2, V3 in parallel.
4. Once compile clean: V4 + V5.
5. Then resume cohort-2 task picking (the 12 pending T-tasks plus the verification tasks above).

Total verification estimated effort: 2–4 hours, depending on how much downstream-worker-vs-T-003 divergence there actually is.


Cohort-1 final stats (at completion)


— Integration notes by driver-claude, 2026-05-05.

Continue exploring