Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
e2d18a0
feat(identity)!: rewrite as one minimal Identity
samternent Nov 27, 2026
4e6c509
feat(seal)!: rewrite as one detached proof over a content hash
samternent Nov 27, 2026
7aafb30
chore(identity, seal): keep only files that describe the current pack…
samternent Nov 27, 2026
872109c
docs(identity, seal): restore agent guides and add package working notes
samternent Nov 27, 2026
5db3bbb
feat(armour)!: rewrite as encrypt and decrypt over bytes
samternent Nov 27, 2026
9db76b8
feat(ledger)!: rewrite as an immutable v2 history with a writer
samternent Nov 27, 2026
365f3c8
ci: stop sealing release bundles
samternent Nov 28, 2026
d42afba
chore(seal)!: remove the Seal CLI and release-sealing tooling
samternent Nov 28, 2026
d751f3d
feat(concord)!: rewrite as a document of events with private groups
samternent Nov 28, 2026
99afc60
chore: bring repository checks and guides in line with the rewritten …
samternent Nov 28, 2026
75fcf34
chore!: remove ui, workspace, docs and everything the five libraries …
samternent Nov 28, 2026
84146ae
fix(concord): stop a member taking over a group with a forged key wrap
samternent Nov 28, 2026
f051a88
fix(concord): bind each record to its group so a relabelled key moves…
samternent Nov 28, 2026
a04aa43
test(concord): test the untested replay rules, and let replay own mem…
samternent Nov 28, 2026
bde4076
docs: drop the stale note about excluded packages from AGENTS.md
samternent Nov 28, 2026
db72036
fix(concord)!: a key belongs to an epoch only through an accepted record
samternent Nov 28, 2026
60b96de
feat(concord)!: make membership public and label events with their group
samternent Nov 28, 2026
64462ee
fix(concord): ignore malformed keys, reject reused recipients and jun…
samternent Nov 28, 2026
afcd7d6
docs: state the recipient rule as the one cross-group check, and unre…
samternent Nov 28, 2026
e01b43b
fix(concord): count unreadable events in unsupported groups
samternent Nov 28, 2026
0955f31
refactor(concord)!: cut rebase and squash, and state the trust model
samternent Nov 28, 2026
d90451a
fix(concord): only an admin can raise a group's model version
samternent Nov 28, 2026
7d8dac8
fix(armour): capture Buffer inputs before async work
samternent Nov 30, 2026
23ec8a4
refactor(concord)!: use one state and reusable encryption permissions
samternent Nov 30, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 2 additions & 3 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Library version intent

Use `pnpm exec changeset add` for changes to the five public libraries. UI and
Workspace are outside this release; private packages are not versioned or tagged.
Use `pnpm exec changeset add` for changes to the five public libraries. Private
packages are not versioned or tagged.

The enabled version workflow opens a draft PR for unconsumed public changesets or
an exit from prerelease mode. `pnpm release:version` checks npm history, validates
Expand All @@ -19,4 +19,3 @@ described in the release contract.

The release planner requires matching committed intent for new package versions.
It freezes the existing tested tarballs, and the publisher never repacks them.
See the [release contract](../docs/engineering/release-and-deployment.md).
28 changes: 28 additions & 0 deletions .changeset/minimal-core.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
---
"@ternent/identity": minor
"@ternent/seal": minor
"@ternent/armour": minor
"@ternent/ledger": minor
"@ternent/concord": minor
---

Replace the five libraries with smaller public interfaces. These are breaking changes
to the pre-1.0 APIs; applications must migrate before upgrading.

- Identity provides identity creation, backup, recovery, exact-byte signing and strict
verification. The version 2 backup and mnemonic derivation path are preserved.
- Seal provides detached content-hash proofs. The CLI, artifacts and manifests are removed.
- Armour encrypts and decrypts bytes with identities, native age keys or a passphrase.
Input bytes, including Node Buffers, are copied when each call starts.
- Ledger uses canonical version 2 histories with a Seal proof per commit. Authoring is
staged, histories are immutable, and comparison never merges diverged copies.
- Concord reconstructs one application state from readable signed events. Plaintext is
the default; optional record encryption uses native age recipients as permission IDs.
Append-only grants share reusable keys, including historical access, without membership,
roles or upgrade governance. Applications own authoring rules through verified reducer
context. Unsupported readable model versions refuse opening. Drafts have one visibility
scope; local encrypted staging requires the selected key for validation and replay.
Captured model configuration, immutable JSON, write isolation and atomic adoption are
preserved. Reducer authors use the same normalized identity during staging and replay.
The stored Concord format and interface break compatibility with the previous
group-based design. No migration adapter is included.
19 changes: 0 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,6 @@ jobs:
run: pnpm check
- name: Freeze the accepted release candidate bundle
run: node scripts/release/cli.mjs verification-plan
- name: Retain the built release verifier tools
run: node scripts/release/flow.mjs capture-tools
- name: Create a disposable proof-test identity
id: seal-test-key
run: node scripts/release/cli.mjs test-identity
- name: Exercise the pinned Seal Action on the release bundle
uses: samternent/seal-action@d07a683a9195a1190c3e15b6e4374a1d59592b57
with:
assets-directory: artifacts/release
manifest-name: release-manifest.json
proof-name: release-proof.json
public-key-name: release-public-key.json
cli-command: '"${{ steps.seal-test-key.outputs.node }}" "${{ github.workspace }}/packages/seal/bin/seal"'
env:
SEAL_IDENTITY_FILE: ${{ steps.seal-test-key.outputs.identity-file }}
- name: Verify the Action proof and every bundled file
run: node scripts/release/cli.mjs verify-seal
env:
SEAL_RELEASE_PUBLIC_KEY: ${{ steps.seal-test-key.outputs.public-key }}
- name: Retain acceptance evidence
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
Expand Down
28 changes: 1 addition & 27 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ jobs:
id-token: write
env:
CORE_RELEASE_ENABLED: ${{ vars.CORE_RELEASE_ENABLED }}
SEAL_RELEASE_PUBLIC_KEY: ${{ vars.SEAL_RELEASE_PUBLIC_KEY }}
RELEASE_SOURCE_SHA: ${{ needs.select.outputs.source-sha }}
RELEASE_ARTIFACT_ID: ${{ needs.select.outputs.artifact-id }}
RELEASE_ARTIFACT_DIGEST: ${{ needs.select.outputs.artifact-digest }}
Expand Down Expand Up @@ -103,40 +102,15 @@ jobs:
pnpm install --frozen-lockfile --ignore-scripts
npm install --global npm@12.2.3 --ignore-scripts --registry=https://registry.npmjs.org/
- run: pnpm exec playwright install --with-deps chromium
- name: Validate producer, download exact artifact and restore verifier tools
- name: Validate producer and download the exact artifact
id: bundle
run: node scripts/release/flow.mjs stage
- name: Validate committed intent, source binding and retained bundle
run: node scripts/release/cli.mjs prepare-release
env:
RELEASE_RESUMED: ${{ steps.bundle.outputs.resumed }}
- name: Materialise the dedicated release identity
if: steps.bundle.outputs.resumed != 'true'
id: identity
run: node scripts/release/cli.mjs release-identity
env:
SEAL_RELEASE_IDENTITY_B64: ${{ secrets.SEAL_RELEASE_IDENTITY_B64 }}
- name: Seal the final release bundle
if: steps.bundle.outputs.resumed != 'true'
uses: samternent/seal-action@d07a683a9195a1190c3e15b6e4374a1d59592b57
with:
assets-directory: artifacts/release
manifest-name: release-manifest.json
proof-name: release-proof.json
public-key-name: release-public-key.json
cli-command: '"${{ steps.bundle.outputs.node }}" "${{ github.workspace }}/packages/seal/bin/seal"'
env:
SEAL_IDENTITY_FILE: ${{ steps.identity.outputs.identity-file }}
- name: Verify the externally trusted release signature
run: node scripts/release/cli.mjs verify-seal
- name: Publish retained bytes, verify fresh consumers and promote the planned channel
run: pnpm release:publish
- name: Remove the temporary signing identity
if: always()
env:
SEAL_IDENTITY_FILE: ${{ steps.identity.outputs.identity-file }}
run: |
if [ -n "$SEAL_IDENTITY_FILE" ]; then rm -f -- "$SEAL_IDENTITY_FILE"; fi
- name: Collect complete or incomplete release evidence
if: always() && steps.bundle.outcome == 'success'
run: node scripts/release/flow.mjs collect
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ node_modules
*.d.ts.map
*.css.map
*.html.map
*.vue.map
*.scss.map
*.sass.map
*.less.map
Expand Down
109 changes: 49 additions & 60 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@ independent of work-specific agents, services, credentials, and workflows.

## Developer archetype: the toolchain engineer

Adopt the [toolchain engineer profile](docs/engineering/developer-archetype.md).
Treat the development feedback loop as part of the product: make checks fast,
Work as a toolchain engineer. Treat the development feedback loop as part of the product: make checks fast,
repeatable, and useful to both people and agents.

- Prefer Oxfmt for formatting and Oxlint for JavaScript/TypeScript linting.
Use installed, repository-configured versions; verify capabilities before
depending on flags or rules. The active workspace uses Vite+ Oxlint through
`pnpm lint`; excluded packages remain outside that check until migrated or retired.
depending on flags or rules. The active workspace uses Vite+ Oxlint through `pnpm lint`.
- Encode repeatable mechanical rules in tooling when practical. Spend review
attention on contracts, behavior, and design decisions.
- Use diagnostics to drive small corrections. Review automatic fixes and scope
Expand Down Expand Up @@ -44,63 +42,54 @@ repeatable, and useful to both people and agents.

## Project context

For architecture or migration work, read [the project brief](docs/concord/context.md).
The accepted clean-rebuild target is
[the alpha architecture](docs/concord/alpha-architecture.md), and canonical domain
language is in [CONTEXT.md](CONTEXT.md). When current packages or their specifications
conflict with that target, treat them as legacy evidence rather than requirements.
Inspect the relevant package README, SPEC, types, and tests for the task at hand.
Existing package `CLAUDE.md` files also contain architecture guidance; read them
when touching that package. They are legacy documentation, not a requirement to
use Claude. Check stale names and contradictions against actual exports and the
user's intended contract.

Keep these target responsibilities distinct:

- Ledger: the standalone signed log, common container, canonicalization, identifiers,
signatures, entry staging, commit construction, verification and ordered replay.
- Concord runtime: compose Ledger with commands, authority, encryption and two-stage
replay. Retain command-intent drafts and previews; delegate signed history to Ledger.
- System extensions: identities, capabilities, audiences, key distribution, and
decryption.
- Application models: typed commands, domain events, validation, and reducers.
- Storage adapters: reading, writing, and any adapter-specific synchronization.
- Identity, Armour, and Seal: independently usable identity, encryption, and proof
primitives.
- Armour integration with Ledger: explicit payload codecs; keep recipients, keys
and decryption outside Ledger's container and history lifecycle.
- Framework adapters and UI: consumers above the runtime.

Do not put application policy into the Concord runtime or system extensions, or
duplicate the owning layer's cryptography and verification in consumers.
Each package's README states its interface and guarantees, and its `CLAUDE.md` the rules
for changing it; read both before touching a package. [CONTEXT.md](CONTEXT.md) holds the
vocabulary.

Keep these responsibilities distinct:

- Identity: one identity, its backup and recovery, exact-byte signing and verification.
- Seal: a detached proof over a content hash.
- Armour: age encryption for identities, native group keys and passphrases.
- Ledger: signed history, canonical bytes, commit and entry IDs, staging, verification
and comparison.
- Concord: one application state from readable signed events, optional record encryption,
reusable permission keys and append-only grants, built on the other four.
- Applications: models, application authoring rules, document access, storage, sync and UI.

Do not put application policy into Concord, or duplicate the owning layer's
cryptography and verification in a consumer.

## Contracts to preserve

- Signed history is authoritative; projection is derived. Storage does not
make a document trustworthy.
- Immediate commit is the default authoring mode. Draft mode may group several commands
into an explicit commit. Storage publication is a separate operation.
- Staged entries and pending command intents stay in memory. Consumers choose commit
cadence and own any draft autosave or recovery; libraries exchange committed history.
See [the draft persistence decision](docs/adr/0019-keep-draft-persistence-with-consumers.md).
- Commit identifiers and signatures bind the canonical unsigned commit subject,
including parent linkage and ordered entry identifiers.
- Invalid reachable committed history cannot produce trusted runtime state.
- Replay is deterministic for identical ordered entries, capabilities, and conforming
pure model implementations. Reissuing a command with fresh keys or timestamps is not
replaying the same input.
- System replay establishes authority and decryptability before application replay.
Publish state only after a successful complete pass.
- Partial replay is not authoritative full reconstruction without genesis or
a valid checkpoint. Preserve read-only runtime behavior.
- Bind actor claims to the signer. Keep historical grants distinct from active
membership; revocation cannot erase keys or plaintext already obtained.
- A document snapshot has one selected head. Classify two snapshots as equal, ahead,
behind, or diverged; never silently combine or choose between divergent histories.
Alpha does not merge divergent histories. Retain both, ask a person to select one, or
author a new document that references both source heads.
- Integrity does not establish freshness or completeness. Detect rollback or withholding
only against a remembered head or another external freshness anchor.
- Signed history is authoritative; state is derived. Storage does not make a document
trustworthy.
- Authoring is `stage` then `commit`; there is no immediate mode. Staged events stay in
memory, and applications own any draft recovery. Storage publication is separate.
- Commit IDs and signatures bind the canonical commit body, its parent and its entries.
- History that fails Ledger verification does not open.
- One application state is reconstructed from each reader's accepted, readable history.
Agreement requires equivalent readable histories and deterministic models; hidden
dependencies can change states and rejections.
- Permissions are reusable native age keys, identified by their public recipients.
Declarations cannot redefine a recipient; descriptive names need not be unique.
Grants disclose private keys and cannot revoke previous disclosure. Future access
changes use a new permission.
- Key possession establishes decryption capability, not application writing authority.
The model receives the verified author and historical batch version and owns its rules.
- Discover historical grants before application replay. A recovered private key must
derive the declared recipient; bad candidates cannot replace a valid key.
- A draft contains plaintext or one permission. Local encrypted staging requires its
key for validation and replay, not as a membership restriction. Competing mutations
reject during asynchronous writes; failed local adoption preserves the draft and state.
- A failing readable batch stays as evidence and changes no application state. Rejections
are relative to the reader's available history and model. Unreadable is not invalid
or empty. Unsupported readable model versions refuse opening; Ledger can still inspect
the bytes independently.
- Copies have one head and are compared, never silently merged.
- Integrity does not establish freshness. Detect rollback or withholding only against a
remembered head.
- State what the raw file can reveal, and claim no privacy beyond it.

## Verification and delivery

Expand All @@ -112,8 +101,8 @@ duplicate the owning layer's cryptography and verification in consumers.
- For package or build changes, verify built public imports, declaration output,
and dependency wiring as well as source tests. A successful build is insufficient
evidence that a consumer can import the package.
- For persistence changes, check reopen, staged-state handling, and the affected
failure or conflict paths. Run applicable type checks and builds.
- For format changes, check reopen, the saved vectors and the affected failure paths.
Run applicable type checks and builds.
- Report passing checks, existing failures, introduced failures, and unverified
behavior separately. Do not weaken assertions to make a failure disappear.
- Keep comments about local rationale. Put change history in the delivery report.
Expand Down
Loading