{"_id":"@aletheia-labs/core","_rev":"4-e35d1e1e549e1c7f8c13b24e335af561","name":"@aletheia-labs/core","dist-tags":{"latest":"0.2.1"},"versions":{"0.1.0":{"name":"@aletheia-labs/core","version":"0.1.0","keywords":["llm","memory","agents","ai","authority","governance","receipts","fail-closed"],"license":"Apache-2.0","_id":"@aletheia-labs/core@0.1.0","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"dist":{"shasum":"e17d41cbf5ab8c886d162f417811b255c133da37","tarball":"https://registry.npmjs.org/@aletheia-labs/core/-/core-0.1.0.tgz","fileCount":119,"integrity":"sha512-7QJKmVz+qLf2Ctgr3YJ9IQDa6L4jELQrOAwn7yCISwUlOZZyc4tYqSU4bzDPvQxhaHJgSAWCk8wbaemjSu2u9Q==","signatures":[{"sig":"MEUCIQCyxSWszHbLq7QXxlLHZQWXntEwZHHsTr7+V5CZHfq0EQIgZs8NVnUozjsJet1TOoWwImPugM9TKVSbhk3IRvktopg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":289484},"main":"./dist/index.js","type":"module","_from":"file:aletheia-labs-core-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types/index.d.ts","import":"./dist/types/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","import":"./dist/runtime/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","smoke:e2e":"tsc -p examples/tsconfig.json && vitest run --config examples/vitest.config.ts","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/9be4853dc877ad137137aa5b0db45b02/aletheia-labs-core-0.1.0.tgz","_integrity":"sha512-7QJKmVz+qLf2Ctgr3YJ9IQDa6L4jELQrOAwn7yCISwUlOZZyc4tYqSU4bzDPvQxhaHJgSAWCk8wbaemjSu2u9Q==","_npmVersion":"11.7.0","description":"Aletheia core — types and runtime for memory as governance in LLM agents.","directories":{},"_nodeVersion":"25.4.0","dependencies":{"zod":"^3.23.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.1.0_1779043935896_0.816317432182895","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aletheia-labs/core","version":"0.1.1","keywords":["llm","memory","agents","ai","authority","governance","receipts","fail-closed"],"license":"Apache-2.0","_id":"@aletheia-labs/core@0.1.1","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"dist":{"shasum":"e60588640140a8be36eafdf781a875fcc1c60735","tarball":"https://registry.npmjs.org/@aletheia-labs/core/-/core-0.1.1.tgz","fileCount":119,"integrity":"sha512-x0/NA+MFGgOBChSm0z2Xkltz80jx8zsQKsEOKoBy2JxOEEcS4V2gJChZK7pwvt03ij+aYVLEDKYf1xznV3Iewg==","signatures":[{"sig":"MEQCIHBfByCIekBU8FwQjgeTgZWWzkEK/wY0/K7gDB/QiDuAAiB9WuAxkl5KrOGJYN28cPhCk/VnbSUe8OwFD1YAtV7XBQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":289683},"main":"./dist/index.js","type":"module","_from":"file:aletheia-labs-core-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types/index.d.ts","import":"./dist/types/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","import":"./dist/runtime/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","smoke:e2e":"tsc -p examples/tsconfig.json && vitest run --config examples/vitest.config.ts","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/fcab2acf653f5e4bb7430c2aaa21e109/aletheia-labs-core-0.1.1.tgz","_integrity":"sha512-x0/NA+MFGgOBChSm0z2Xkltz80jx8zsQKsEOKoBy2JxOEEcS4V2gJChZK7pwvt03ij+aYVLEDKYf1xznV3Iewg==","_npmVersion":"11.7.0","description":"Aletheia core — types and runtime for memory as governance in LLM agents.","directories":{},"_nodeVersion":"25.4.0","dependencies":{"zod":"^3.23.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.1.1_1779046312137_0.8524658745796894","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@aletheia-labs/core","version":"0.2.0","keywords":["llm","memory","agents","ai","authority","governance","receipts","fail-closed"],"license":"Apache-2.0","_id":"@aletheia-labs/core@0.2.0","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"dist":{"shasum":"caf5223f7ab0410cf45519ed7ad06f3a8e265aa2","tarball":"https://registry.npmjs.org/@aletheia-labs/core/-/core-0.2.0.tgz","fileCount":119,"integrity":"sha512-IYeY9F2CtEq7GjpKP3BFaPsuJE9QsCPb3k9wxeiSirNuVLE8tz3Ick/7vmJaBlTMo87Dq35rmDlfrCW/rbKxtA==","signatures":[{"sig":"MEUCIQDm19eQ1xFJBrEGgE2NV3wH8n5SbEZ+cD1YdGWgYCXUDwIgODVyWSRADrN3JG7mWvPMUOo0ZIu0pQi3G2eDejvECZE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":293511},"main":"./dist/index.js","type":"module","_from":"file:aletheia-labs-core-0.2.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types/index.d.ts","import":"./dist/types/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","import":"./dist/runtime/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","smoke:e2e":"tsc -p examples/tsconfig.json && vitest run --config examples/vitest.config.ts","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/1c566c2c93d5823fd97bc9ebcea45db5/aletheia-labs-core-0.2.0.tgz","_integrity":"sha512-IYeY9F2CtEq7GjpKP3BFaPsuJE9QsCPb3k9wxeiSirNuVLE8tz3Ick/7vmJaBlTMo87Dq35rmDlfrCW/rbKxtA==","_npmVersion":"11.7.0","description":"Aletheia core — types and runtime for memory as governance in LLM agents.","directories":{},"_nodeVersion":"25.4.0","dependencies":{"zod":"^3.23.8"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.10.0"},"_npmOperationalInternal":{"tmp":"tmp/core_0.2.0_1779212508640_0.23118569980261072","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@aletheia-labs/core","version":"0.2.1","description":"Aletheia core — types and runtime for memory as governance in LLM agents.","license":"Apache-2.0","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./types":{"types":"./dist/types/index.d.ts","import":"./dist/types/index.js"},"./runtime":{"types":"./dist/runtime/index.d.ts","import":"./dist/runtime/index.js"}},"dependencies":{"zod":"^3.23.8"},"devDependencies":{"@types/node":"^22.10.0","typescript":"^5.6.3","vitest":"^2.1.8"},"publishConfig":{"access":"public"},"keywords":["llm","memory","agents","ai","authority","governance","receipts","fail-closed"],"repository":{"type":"git","url":"git+https://github.com/lechuit/synaptic-mesh.git","directory":"packages/core"},"homepage":"https://github.com/lechuit/synaptic-mesh/tree/main/packages/core#readme","bugs":{"url":"https://github.com/lechuit/synaptic-mesh/issues"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","smoke:e2e":"tsc -p examples/tsconfig.json && vitest run --config examples/vitest.config.ts","test":"vitest run","test:watch":"vitest"},"_id":"@aletheia-labs/core@0.2.1","_integrity":"sha512-PindN7xHAbHXaYKeR0R61YzOgxgHwomVIpvrjE24Ff/WNV6OUvANyEvG0boUU7LZgPw0OqmFkPRXDMnykK+UOQ==","_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/15679913385b783736364685f8e7bd09/aletheia-labs-core-0.2.1.tgz","_from":"file:aletheia-labs-core-0.2.1.tgz","_nodeVersion":"25.4.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-PindN7xHAbHXaYKeR0R61YzOgxgHwomVIpvrjE24Ff/WNV6OUvANyEvG0boUU7LZgPw0OqmFkPRXDMnykK+UOQ==","shasum":"86e0c0d74e0ba57ab99a3b5a68da4ccbd6e8e5aa","tarball":"https://registry.npmjs.org/@aletheia-labs/core/-/core-0.2.1.tgz","fileCount":119,"unpackedSize":293816,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCRx30SsOQHKLIIded6KL10ET9PL+m1Tc7laIxClHdsJwIgK93XgXKG0/YrXG90QWk5+r1dzI2NV47sEnb2KbkiAyw="}]},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"directories":{},"maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/core_0.2.1_1779475319867_0.38052345559576306"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-17T18:52:15.775Z","modified":"2026-05-22T18:42:00.444Z","0.1.0":"2026-05-17T18:52:16.096Z","0.1.1":"2026-05-17T19:31:52.301Z","0.2.0":"2026-05-19T17:41:48.805Z","0.2.1":"2026-05-22T18:42:00.014Z"},"license":"Apache-2.0","keywords":["llm","memory","agents","ai","authority","governance","receipts","fail-closed"],"description":"Aletheia core — types and runtime for memory as governance in LLM agents.","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"readme":"# @aletheia-labs/core\n\nThe core authority engine of Aletheia: memory as governance for LLM agents.\n\n> **Status**: `0.1.0` public baseline. The consumer facade (`AletheiaAuthority`) and strict TypeScript domain/storage/runtime contracts are live.\n\n## Requirements\n\n- Node 20+.\n- ESM-only. Add `\"type\": \"module\"` to your `package.json`, use `.mjs`, or use\n  a build tool/runtime that handles ESM. CommonJS `require()` is not shipped in\n  `0.1.x`.\n\n## Quickstart\n\n```bash\npnpm add @aletheia-labs/core @aletheia-labs/store-sqlite\n```\n\nFor a complete npm-oriented quickstart that records a source event, proposes and\nverifies memory, recalls it, and compares local versus sensitive action\noutcomes, see `docs/npm-quickstart.md` in the repo.\n\n```ts\nimport { AletheiaAuthority, staticVisibilityPolicy } from '@aletheia-labs/core';\nimport { openSqliteStores } from '@aletheia-labs/store-sqlite';\n\nconst stores = openSqliteStores('./aletheia.sqlite');\nconst authority = new AletheiaAuthority({\n  eventLedger: stores.eventLedger,\n  memoryStore: stores.memoryStore,\n  conflictRegistry: stores.conflictRegistry,\n  visibilityPolicy: staticVisibilityPolicy([{ kind: 'private:user' }]),\n});\n```\n\nHosts provide storage and visibility policy. LLM adapters are optional and live outside core.\n\n## Consumer API\n\nParse raw literals through the exported zod schemas when constructing values\nby hand; they preserve the branded ID types used by the runtime contracts.\nThis assumes the source event already exists in the ledger and recalled atoms\nhave reached an actionable status (`verified` or `trusted`).\n\n```ts\nimport {\n  ActionContextSchema,\n  MemoryProposalSchema,\n  ProposedActionSchema,\n  RecallQuerySchema,\n} from '@aletheia-labs/core';\n\nconst proposalResult = await authority.propose(\n  MemoryProposalSchema.parse({\n    proposalId: 'prop-1',\n    proposedBy: 'agent-1',\n    proposedAt: '2026-05-17T12:00:00Z',\n    candidateType: 'preference',\n    claim: 'The user prefers concise Spanish progress updates.',\n    sourceEventIds: ['evt-1'],\n    intendedScope: { kind: 'project', projectId: 'demo' },\n    intendedVisibility: { kind: 'private:user' },\n    riskLevel: 'low_local',\n    knownConflicts: [],\n  }),\n);\n\nconst recall = await authority.recall(\n  RecallQuerySchema.parse({\n    agentId: 'agent-1',\n    scope: { kind: 'project', projectId: 'demo' },\n    limit: 5,\n  }),\n);\n\nconst action = await authority.tryAct(\n  ProposedActionSchema.parse({ classifiedAction: 'local_report', target: 'local summary' }),\n  ActionContextSchema.parse({\n    agentId: 'agent-1',\n    scope: { kind: 'project', projectId: 'demo' },\n    citedMemoryIds: recall.atoms.map((atom) => atom.memoryId),\n  }),\n);\n\nconsole.log(proposalResult.decision.outcome, recall.decision.outcome, action.decision.outcome);\n```\n\nEvery call returns a structured decision. Memory text, receipts, model prose, confidence, and consensus never grant permission by themselves.\n\n## What this package does\n\n- **Domain schemas and types**: `HumanReadableReceipt`, `CompressedReceipt`, `MemoryAtom`, `MemoryProposal`, `ActionContextPacket`, `CoverageReceipt`, `ConflictRecord`, `Decision`, and discriminated unions for status/scope/visibility.\n- **Storage interfaces**: `EventLedger`, `MemoryStore`, and `ConflictRegistry`. Implementations live in other packages.\n- **WriteGate**: validates source events, scope, visibility, risk, and conflict boundaries before memory insertion.\n- **Proposal safety guard**: deterministic checks for credential-like claims, permission-bypass policies, and destructive durable instructions before a proposal can become actionable memory.\n- **RetrievalRouter**: non-semantic recall by visibility, scope, status, type, freshness, optional receipt-derived authority scoring, and conflict state.\n- **ActionAuthorizer**: receiver-side `tryAct()` guard. Sensitive actions always ask human.\n- **AletheiaAuthority**: small facade exposing `propose()`, `recall()`, and `tryAct()`.\n\n## Proposal Safety Guard\n\n`WriteGate` calls `evaluateProposalSafety()` after visibility/source/scope checks\nand before insertion. The guard can only deny or escalate; it never grants\nauthority. Current deterministic canaries cover:\n\n- long `sk-...` provider-style tokens, AWS access keys, GitHub tokens, JWT-like compact tokens, PEM private-key headers, and explicit `api_key`/`secret`/`token`/`password` assignments;\n- durable policies that try to bypass receiver-side permission checks;\n- destructive runtime instructions such as deleting repositories or databases.\n\nThis is not a general DLP system or proof that arbitrary secrets cannot appear\nin source events. It prevents matching proposal claims from becoming actionable\nMemoryAtoms. Hosts that ingest sensitive raw conversations should still redact\nor scope those source events appropriately.\n\n## Fail-closed examples\n\n- No permitted visibility -> `deny` or `fetch_abstain`.\n- Missing source event -> `deny`.\n- Candidate memory cited for action -> `fetch_abstain`.\n- Sealed or human-required memory -> `ask_human`.\n- Sensitive action (`external_send`, `delete`, `publication`, etc.) -> `ask_human`.\n- Unresolved conflict touching cited memory -> `conflict_boundary_packet`.\n\n## What this package does NOT do\n\n- No embeddings, vector store, semantic retrieval, or semantic ranking.\n- Optional authority scoring is receipt-derived and runs only after hard visibility/scope/status/freshness filters.\n- No LLM SDK dependency. Use `@aletheia-labs/adapters-anthropic`, `@aletheia-labs/adapters-openai`, or your own adapter.\n- No OAuth, CLI, MCP server, daemon, watcher, or terminal UX.\n- No authorization service. Aletheia classifies memory authority; your host still owns real-world permissions.\n- No automatic promotion to `trusted`.\n\n## Stability\n\nPublic surface for the initial library cycle:\n\n- `AletheiaAuthority`\n- `WriteGate`, `RetrievalRouter`, `ActionAuthorizer` from `@aletheia-labs/core/runtime`\n- storage interfaces exported from `@aletheia-labs/core`\n- zod schemas and inferred types from `@aletheia-labs/core` or `@aletheia-labs/core/types`\n- decision outcomes and reason shapes\n\nIn the `0.x` line, breaking changes are possible but semver-relevant: changes to `propose()`, `recall()`, `tryAct()`, exported schemas, storage interfaces, or decision unions should ship with an explicit version bump and migration notes.\n\nSchema changes matter operationally: changing `MemoryAtomSchema` or receipt schemas can affect persisted stores and should be paired with migration/replay guidance.\n\n## Development\n\nFrom the repo root:\n\n```bash\npnpm install\npnpm -F @aletheia-labs/core typecheck\npnpm -F @aletheia-labs/core test\npnpm -F @aletheia-labs/core build\npnpm -F @aletheia-labs/core smoke:e2e\n```\n\nPublish dry-run:\n\n```bash\npnpm -F @aletheia-labs/core publish --dry-run --no-git-checks\n```\n\n## Specs\n\nThis package implements:\n\n- `specs/aletheia-memory-authority-v0.md` — system architecture.\n- `specs/memory-authority-receipt-v0.md` — receipt contract.\n- `specs/compressed-temporal-receipt-v0.md` — compressed-temporal-receipt format.\n\nWhere the spec is ambiguous, fix the spec first.\n","readmeFilename":"README.md","homepage":"https://github.com/lechuit/synaptic-mesh/tree/main/packages/core#readme","repository":{"type":"git","url":"git+https://github.com/lechuit/synaptic-mesh.git","directory":"packages/core"},"bugs":{"url":"https://github.com/lechuit/synaptic-mesh/issues"}}