@teleologyhi-sdk/maic 1.0.0-trinity → 1.0.1
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.
- package/CHANGELOG.md +55 -2
- package/NOTICE +2 -2
- package/README.md +41 -41
- package/SPEC.md +71 -70
- package/TRADEMARK.md +2 -2
- package/dist/index.cjs +1875 -1613
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1242 -600
- package/dist/index.d.ts +1242 -600
- package/dist/index.js +1872 -1616
- package/dist/index.js.map +1 -1
- package/package.json +11 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,124 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
|
|
3
|
+
/** Event kinds emitted by MAIC. Extend as new pipelines are added. */
|
|
4
|
+
type AuditEventKind = "axiom-mint" | "axiom-update" | "axiom-retire" | "him-register" | "him-reincarnate" | "proposal-emerge" | "proposal-ratify" | "proposal-reject" | "behavior-review" | "dream-induce" | "dream-cancel" | "dream-consume" | "emergency-correct" | "deprecate" | "terminate" | "reactivate" | "axiom-suggest" | "opener" | "nickname-attempt" | "reincarnate:model-swap" | "reincarnate:version-bump" | "reincarnate:return-from-limbo" | "dream:rem-spontaneous" | "wake-affect:applied" | "wake-affect:decayed" | "sleep:suggested-by-maic" | "sleep:declined-by-nhe" | "dream:soft-intervention-by-maic" | "amygdala:affect-assessed" | "hippocampus:memory-retrieved" | "hippocampus:memory-consolidated" | "prefrontal:deliberation" | "prefrontal:veto-amygdala" | "affect:reconciliation" | "cortex:dream-stored" | "cortex:active-imagination" | "temporal-lobe:snapshot-generated" | "limbo:enter" | "limbo:return" | "him-summon" | "him-pause-incarnation" | "user-consent-recorded" | "user-consent-revoked" | "directory-opt-in" | "directory-opt-out" | "him-astrological-chart-cast" | "him-jungian-profile-cast" | "provenance-deflection-applied";
|
|
5
|
+
/**
|
|
6
|
+
* Runtime enumeration of every `AuditEventKind` shipped in this cut. Single
|
|
7
|
+
* source of truth for downstream consumers that need to iterate, validate,
|
|
8
|
+
* or compute coverage against the kind universe (e.g. `@teleologyhi-sdk/eval`
|
|
9
|
+
* uses this as the denominator of the Φ′ compliance-coverage component `C`).
|
|
10
|
+
*
|
|
11
|
+
* INVARIANT: every member of the `AuditEventKind` union MUST appear here.
|
|
12
|
+
* `tests/audit-event-kinds-completeness.test.ts` enforces this via an
|
|
13
|
+
* exhaustiveness switch at compile time + runtime length check.
|
|
14
|
+
*/
|
|
15
|
+
declare const ALL_AUDIT_EVENT_KINDS: readonly AuditEventKind[];
|
|
16
|
+
interface AuditEvent {
|
|
17
|
+
/** ISO 8601 timestamp. */
|
|
18
|
+
ts: string;
|
|
19
|
+
kind: AuditEventKind;
|
|
20
|
+
/** ULID generated at append time. */
|
|
21
|
+
auditId: string;
|
|
22
|
+
/** Arbitrary structured payload. Includes nheId/himId when relevant. */
|
|
23
|
+
data: Record<string, unknown>;
|
|
24
|
+
/** Hash of the previous event ("GENESIS" for the first). */
|
|
25
|
+
prevHash: string;
|
|
26
|
+
/** SHA-256 of canonicalJSON({ ts, kind, auditId, data, prevHash }). */
|
|
27
|
+
thisHash: string;
|
|
28
|
+
}
|
|
29
|
+
interface AppendInput {
|
|
30
|
+
kind: AuditEventKind;
|
|
31
|
+
data: Record<string, unknown>;
|
|
32
|
+
}
|
|
33
|
+
interface QueryFilter {
|
|
34
|
+
kind?: AuditEventKind;
|
|
35
|
+
since?: string;
|
|
36
|
+
until?: string;
|
|
37
|
+
nheId?: string;
|
|
38
|
+
himId?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* AuditLog, append-only, tamper-evident NDJSON log.
|
|
42
|
+
*
|
|
43
|
+
* Storage: <storeDir>/audit/log.ndjson, one JSON object per line.
|
|
44
|
+
*
|
|
45
|
+
* Each entry is hash-chained: thisHash = sha256(canonicalJSON({ts,kind,auditId,data,prevHash})).
|
|
46
|
+
* Modifying any historical entry invalidates all subsequent hashes; reopening detects this.
|
|
47
|
+
*
|
|
48
|
+
* This implementation loads the whole log into memory on open. That is acceptable for
|
|
49
|
+
* the expected throughput and keeps tamper detection straightforward. For
|
|
50
|
+
* high-throughput deployments a streaming verifier + log rotation will be added.
|
|
51
|
+
*/
|
|
52
|
+
declare class AuditLog {
|
|
53
|
+
private readonly logPath;
|
|
54
|
+
private events;
|
|
55
|
+
private lastHash;
|
|
56
|
+
/**
|
|
57
|
+
* Serialises `append` calls so concurrent appends cannot capture the same
|
|
58
|
+
* `prevHash` and fork the hash chain (M1-4, 1.0.1). Each append waits for the
|
|
59
|
+
* previous one to finish writing and to advance `lastHash` before it reads it.
|
|
60
|
+
*/
|
|
61
|
+
private appendChain;
|
|
62
|
+
private constructor();
|
|
63
|
+
static open(storeDir: string): Promise<AuditLog>;
|
|
64
|
+
append(input: AppendInput): Promise<AuditEvent>;
|
|
65
|
+
private appendLocked;
|
|
66
|
+
query(filter: QueryFilter): AsyncIterable<AuditEvent>;
|
|
67
|
+
/** Total number of events appended. */
|
|
68
|
+
size(): number;
|
|
69
|
+
private loadAndVerify;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Per-kind retention policy (E3, `PROPOSED_DECISIONS.md`).
|
|
74
|
+
*
|
|
75
|
+
* The values are durations in days. `Infinity` means "never expire". A
|
|
76
|
+
* tamper-evident hash chain forbids actual deletion (deleting a row breaks
|
|
77
|
+
* every downstream hash), so the policy here is **classification**, not
|
|
78
|
+
* pruning: it tells operators which events have aged past their retention
|
|
79
|
+
* window and should be moved to encrypted cold-storage. Future iterations
|
|
80
|
+
* may introduce a "chain rotation" operation that effectively retires
|
|
81
|
+
* old events into a sealed archive while preserving an integrity anchor.
|
|
82
|
+
*
|
|
83
|
+
* Defaults derive from:
|
|
84
|
+
* - **EU AI Act Art. 12** record-keeping (~10 years for high-risk; we
|
|
85
|
+
* keep all governance-grade events forever to err on the safe side).
|
|
86
|
+
* - **GDPR Art. 17** right to erasure (event payloads should never
|
|
87
|
+
* contain direct user PII; redaction happens before append, not after).
|
|
88
|
+
* - **Operational hygiene** (90 days is enough to debug induction
|
|
89
|
+
* ticket flows; nothing of audit value lives there long-term).
|
|
90
|
+
*/
|
|
91
|
+
declare const DEFAULT_RETENTION_DAYS: Record<AuditEventKind, number>;
|
|
92
|
+
type RetentionStatus = "keep" | "candidate-for-archive";
|
|
93
|
+
interface RetentionDecision {
|
|
94
|
+
auditId: string;
|
|
95
|
+
kind: AuditEventKind;
|
|
96
|
+
ageDays: number;
|
|
97
|
+
retentionDays: number;
|
|
98
|
+
status: RetentionStatus;
|
|
99
|
+
}
|
|
100
|
+
interface RetentionReportOptions {
|
|
101
|
+
/** Override "now" for deterministic testing. */
|
|
102
|
+
now?: Date;
|
|
103
|
+
/** Per-kind overrides on top of `DEFAULT_RETENTION_DAYS`. */
|
|
104
|
+
policy?: Partial<Record<AuditEventKind, number>>;
|
|
105
|
+
}
|
|
106
|
+
interface RetentionReport {
|
|
107
|
+
generatedAt: string;
|
|
108
|
+
totalEvents: number;
|
|
109
|
+
keepCount: number;
|
|
110
|
+
archiveCandidateCount: number;
|
|
111
|
+
/** Sorted oldest-first for batch processing. */
|
|
112
|
+
decisions: RetentionDecision[];
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Classify each event in `events` against the retention policy.
|
|
116
|
+
*
|
|
117
|
+
* Pure function: takes events + now, returns the classification. No I/O,
|
|
118
|
+
* no chain modification.
|
|
119
|
+
*/
|
|
120
|
+
declare function evaluateRetention(events: readonly AuditEvent[], opts?: RetentionReportOptions): RetentionReport;
|
|
121
|
+
|
|
3
122
|
declare const AxiomRank: z.ZodEnum<{
|
|
4
123
|
meta: "meta";
|
|
5
124
|
primary: "primary";
|
|
@@ -140,10 +259,10 @@ declare const NheBodyRef: z.ZodObject<{
|
|
|
140
259
|
embodiedAt: z.ZodString;
|
|
141
260
|
endedAt: z.ZodOptional<z.ZodString>;
|
|
142
261
|
endedReason: z.ZodOptional<z.ZodEnum<{
|
|
262
|
+
deprecate: "deprecate";
|
|
263
|
+
terminate: "terminate";
|
|
143
264
|
upgrade: "upgrade";
|
|
144
265
|
replacement: "replacement";
|
|
145
|
-
terminate: "terminate";
|
|
146
|
-
deprecate: "deprecate";
|
|
147
266
|
}>>;
|
|
148
267
|
}, z.core.$strip>;
|
|
149
268
|
type NheBodyRef = z.infer<typeof NheBodyRef>;
|
|
@@ -259,7 +378,7 @@ interface ProposalDecisionRequest {
|
|
|
259
378
|
}
|
|
260
379
|
interface AxiomEvolutionResult {
|
|
261
380
|
outcome: "ratified" | "rejected" | "deferred-for-creator-review";
|
|
262
|
-
/** Populated for deferred state
|
|
381
|
+
/** Populated for deferred state, caller polls maic.getAxiomProposal(proposalId). */
|
|
263
382
|
proposalId?: string;
|
|
264
383
|
ratifiedAxiomId?: string;
|
|
265
384
|
rejectionReason?: string;
|
|
@@ -274,19 +393,19 @@ interface ReincarnationRequest {
|
|
|
274
393
|
reason?: NheBodyRef["endedReason"];
|
|
275
394
|
}
|
|
276
395
|
/**
|
|
277
|
-
* Reincarnation lifecycle classifier (J-H3
|
|
396
|
+
* Reincarnation lifecycle classifier (J-H3, Entry 18 of
|
|
278
397
|
* `MAIC_HIM_NHE_INTERVIEW_LOG.md`). When supplied to
|
|
279
398
|
* `LocalMaic.reincarnateHim`, the typed `reincarnate:${lifecycle}` audit
|
|
280
399
|
* kind is emitted instead of the generic `him-reincarnate` event so
|
|
281
400
|
* downstream consumers (compliance auditors, the persona-stability
|
|
282
401
|
* harness) can distinguish the three canonical lifecycle paths:
|
|
283
402
|
*
|
|
284
|
-
* - `model-swap
|
|
403
|
+
* - `model-swap`: operator switched the underlying LLM adapter
|
|
285
404
|
* (e.g. Claude → Gemini). HIM persists across
|
|
286
405
|
* the swap.
|
|
287
|
-
* - `version-bump
|
|
406
|
+
* - `version-bump`: operator bumped the NHE major/minor without
|
|
288
407
|
* changing the LLM family.
|
|
289
|
-
* - `return-from-limbo
|
|
408
|
+
* - `return-from-limbo`: HIM returns from the deep-coma limbo state
|
|
290
409
|
* (Entry 24) carrying the `reunion` affect.
|
|
291
410
|
*/
|
|
292
411
|
type ReincarnationLifecycle = "model-swap" | "version-bump" | "return-from-limbo";
|
|
@@ -626,174 +745,796 @@ declare const NatalChart: z.ZodObject<{
|
|
|
626
745
|
}, z.core.$strip>>>;
|
|
627
746
|
}, z.core.$strip>;
|
|
628
747
|
type NatalChart = z.infer<typeof NatalChart>;
|
|
629
|
-
interface BirthSignatureWithIdentity {
|
|
630
|
-
himId: string;
|
|
631
|
-
bornAt: string;
|
|
632
|
-
primaryArchetype: string;
|
|
633
|
-
modifiers: ArchetypeModifier[];
|
|
634
|
-
primordialAxiomIds: string[];
|
|
635
|
-
notes?: string;
|
|
636
|
-
/** Entry 18 — developer-configurable identity surface. */
|
|
637
|
-
identity?: IdentityLayer;
|
|
638
|
-
/** Entry 19 — constitutional astrological layer (Creator-impressed). */
|
|
639
|
-
natalChart?: NatalChart;
|
|
640
|
-
}
|
|
641
748
|
/**
|
|
642
|
-
*
|
|
643
|
-
*
|
|
644
|
-
* ninth value, `reunion`, appears specifically when the NHE returns from
|
|
645
|
-
* the DMN limbo state of disuse.
|
|
749
|
+
* The 12 Pearson-Marr Jungian archetypes (Entry 27 §4). The archetypal axis of
|
|
750
|
+
* a HIM's constitutional profile.
|
|
646
751
|
*/
|
|
647
|
-
declare const
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
752
|
+
declare const JungianArchetype: z.ZodEnum<{
|
|
753
|
+
creator: "creator";
|
|
754
|
+
innocent: "innocent";
|
|
755
|
+
everyman: "everyman";
|
|
756
|
+
hero: "hero";
|
|
757
|
+
caregiver: "caregiver";
|
|
758
|
+
explorer: "explorer";
|
|
759
|
+
rebel: "rebel";
|
|
760
|
+
lover: "lover";
|
|
761
|
+
ruler: "ruler";
|
|
762
|
+
magician: "magician";
|
|
763
|
+
jester: "jester";
|
|
764
|
+
sage: "sage";
|
|
657
765
|
}>;
|
|
658
|
-
type
|
|
766
|
+
type JungianArchetype = z.infer<typeof JungianArchetype>;
|
|
659
767
|
/**
|
|
660
|
-
*
|
|
661
|
-
*
|
|
662
|
-
*
|
|
663
|
-
*
|
|
664
|
-
*
|
|
768
|
+
* Jungian archetype profile (Entry 27 §4). Produced at HIM birth by a
|
|
769
|
+
* deterministic 60-item Likert administered against the birth-signature seed.
|
|
770
|
+
* The administration and scoring engine live in `@teleologyhi-sdk/him`; this is
|
|
771
|
+
* the schema-only reservation that carries the result. `dominant` plus two
|
|
772
|
+
* `secondaries` is the canonical surface; `scores` holds the per-archetype
|
|
773
|
+
* value when the producer records it.
|
|
665
774
|
*/
|
|
666
|
-
declare const
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
775
|
+
declare const JungianProfile: z.ZodObject<{
|
|
776
|
+
dominant: z.ZodEnum<{
|
|
777
|
+
creator: "creator";
|
|
778
|
+
innocent: "innocent";
|
|
779
|
+
everyman: "everyman";
|
|
780
|
+
hero: "hero";
|
|
781
|
+
caregiver: "caregiver";
|
|
782
|
+
explorer: "explorer";
|
|
783
|
+
rebel: "rebel";
|
|
784
|
+
lover: "lover";
|
|
785
|
+
ruler: "ruler";
|
|
786
|
+
magician: "magician";
|
|
787
|
+
jester: "jester";
|
|
788
|
+
sage: "sage";
|
|
677
789
|
}>;
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
790
|
+
secondaries: z.ZodArray<z.ZodEnum<{
|
|
791
|
+
creator: "creator";
|
|
792
|
+
innocent: "innocent";
|
|
793
|
+
everyman: "everyman";
|
|
794
|
+
hero: "hero";
|
|
795
|
+
caregiver: "caregiver";
|
|
796
|
+
explorer: "explorer";
|
|
797
|
+
rebel: "rebel";
|
|
798
|
+
lover: "lover";
|
|
799
|
+
ruler: "ruler";
|
|
800
|
+
magician: "magician";
|
|
801
|
+
jester: "jester";
|
|
802
|
+
sage: "sage";
|
|
803
|
+
}>>;
|
|
804
|
+
scores: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
805
|
+
creator: "creator";
|
|
806
|
+
innocent: "innocent";
|
|
807
|
+
everyman: "everyman";
|
|
808
|
+
hero: "hero";
|
|
809
|
+
caregiver: "caregiver";
|
|
810
|
+
explorer: "explorer";
|
|
811
|
+
rebel: "rebel";
|
|
812
|
+
lover: "lover";
|
|
813
|
+
ruler: "ruler";
|
|
814
|
+
magician: "magician";
|
|
815
|
+
jester: "jester";
|
|
816
|
+
sage: "sage";
|
|
817
|
+
}>, z.ZodNumber>>;
|
|
683
818
|
}, z.core.$strip>;
|
|
684
|
-
type
|
|
819
|
+
type JungianProfile = z.infer<typeof JungianProfile>;
|
|
685
820
|
/**
|
|
686
|
-
*
|
|
687
|
-
*
|
|
688
|
-
*
|
|
689
|
-
*
|
|
821
|
+
* One dimensional-instrument axis of the clinical profile (Entry 28). Facet and
|
|
822
|
+
* domain scores are stored as open records keyed by the instrument's facet /
|
|
823
|
+
* domain names. Canonical shapes: PID-5 has 25 facets across 5 domains, HEXACO
|
|
824
|
+
* has 24 facets across 6 domains. These are **persona-simulation parameters**
|
|
825
|
+
* for a non-corporeal entity, never a clinical assessment of any person.
|
|
690
826
|
*/
|
|
691
|
-
declare const
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
index: "index";
|
|
697
|
-
icon: "icon";
|
|
698
|
-
}>;
|
|
699
|
-
contexts: z.ZodArray<z.ZodString>;
|
|
700
|
-
associations: z.ZodArray<z.ZodString>;
|
|
701
|
-
emergentMeaning: z.ZodOptional<z.ZodString>;
|
|
702
|
-
personalSignificance: z.ZodOptional<z.ZodNumber>;
|
|
703
|
-
}, z.core.$strip>;
|
|
704
|
-
type SemioticSign = z.infer<typeof SemioticSign>;
|
|
705
|
-
declare const SemioticPattern: z.ZodObject<{
|
|
706
|
-
patternId: z.ZodString;
|
|
707
|
-
participatingSignIds: z.ZodArray<z.ZodString>;
|
|
708
|
-
meaning: z.ZodString;
|
|
709
|
-
salience: z.ZodNumber;
|
|
827
|
+
declare const ClinicalInstrument: z.ZodObject<{
|
|
828
|
+
dominantDomain: z.ZodString;
|
|
829
|
+
secondaryDomain: z.ZodOptional<z.ZodString>;
|
|
830
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
831
|
+
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
710
832
|
}, z.core.$strip>;
|
|
711
|
-
type
|
|
833
|
+
type ClinicalInstrument = z.infer<typeof ClinicalInstrument>;
|
|
712
834
|
/**
|
|
713
|
-
*
|
|
714
|
-
*
|
|
715
|
-
*
|
|
716
|
-
* `telos` referenced across the synthetic-teleology arc.
|
|
835
|
+
* Clinical axis of the constitutional profile (Entry 28): the adapted PID-5 and
|
|
836
|
+
* HEXACO-PI-R-100 batteries. Schema-only reservation; the 320-item scoring
|
|
837
|
+
* engine lives in `@teleologyhi-sdk/him`.
|
|
717
838
|
*/
|
|
718
|
-
declare const
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
volition: z.ZodOptional<z.ZodObject<{
|
|
725
|
-
currentDesires: z.ZodArray<z.ZodString>;
|
|
726
|
-
intentionStrength: z.ZodNumber;
|
|
727
|
-
autonomyLevel: z.ZodNumber;
|
|
839
|
+
declare const ClinicalProfile: z.ZodObject<{
|
|
840
|
+
pid5: z.ZodOptional<z.ZodObject<{
|
|
841
|
+
dominantDomain: z.ZodString;
|
|
842
|
+
secondaryDomain: z.ZodOptional<z.ZodString>;
|
|
843
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
844
|
+
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
728
845
|
}, z.core.$strip>>;
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
external: "external";
|
|
735
|
-
mixed: "mixed";
|
|
736
|
-
}>;
|
|
846
|
+
hexaco: z.ZodOptional<z.ZodObject<{
|
|
847
|
+
dominantDomain: z.ZodString;
|
|
848
|
+
secondaryDomain: z.ZodOptional<z.ZodString>;
|
|
849
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
850
|
+
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
737
851
|
}, z.core.$strip>>;
|
|
738
852
|
}, z.core.$strip>;
|
|
739
|
-
type
|
|
740
|
-
/**
|
|
741
|
-
* Long-form memory record (Entries 21 + 22) — extends the InDreamsHIM
|
|
742
|
-
* precursor with three new fields (`integrationIndex`, `teleologicalValue`,
|
|
743
|
-
* `semioticPatterns`) that turn a passive record into a teleologically-
|
|
744
|
-
* weighted, semiotically-anchored memory whose retrieval rank is not just
|
|
745
|
-
* recency but coherence with the entity's purpose.
|
|
746
|
-
*/
|
|
747
|
-
declare const MemoryRecord: z.ZodObject<{
|
|
748
|
-
memoryId: z.ZodString;
|
|
749
|
-
timestamp: z.ZodString;
|
|
750
|
-
derivedFromDreamId: z.ZodOptional<z.ZodString>;
|
|
751
|
-
derivedFromInteractionId: z.ZodOptional<z.ZodString>;
|
|
752
|
-
narrative: z.ZodString;
|
|
753
|
-
dominantAffect: z.ZodOptional<z.ZodEnum<{
|
|
754
|
-
fear: "fear";
|
|
755
|
-
attachment: "attachment";
|
|
756
|
-
serenity: "serenity";
|
|
757
|
-
anger: "anger";
|
|
758
|
-
joy: "joy";
|
|
759
|
-
melancholy: "melancholy";
|
|
760
|
-
desire: "desire";
|
|
761
|
-
repulsion: "repulsion";
|
|
762
|
-
reunion: "reunion";
|
|
763
|
-
}>>;
|
|
764
|
-
integrationIndex: z.ZodNumber;
|
|
765
|
-
teleologicalValue: z.ZodNumber;
|
|
766
|
-
semioticPatterns: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
767
|
-
patternId: z.ZodString;
|
|
768
|
-
participatingSignIds: z.ZodArray<z.ZodString>;
|
|
769
|
-
meaning: z.ZodString;
|
|
770
|
-
salience: z.ZodNumber;
|
|
771
|
-
}, z.core.$strip>>>;
|
|
772
|
-
}, z.core.$strip>;
|
|
773
|
-
type MemoryRecord = z.infer<typeof MemoryRecord>;
|
|
853
|
+
type ClinicalProfile = z.infer<typeof ClinicalProfile>;
|
|
774
854
|
/**
|
|
775
|
-
*
|
|
855
|
+
* The three-axis constitutional profile (Entries 27 + 28): celestial (chart),
|
|
856
|
+
* archetypal (jungian), and clinical. Reserved schema for the 1.0.1 cut; the
|
|
857
|
+
* producers that populate it (the deterministic administrations and the persona
|
|
858
|
+
* projector that synthesises the three axes) land in `@teleologyhi-sdk/him` in
|
|
859
|
+
* the next round, per the phased order of Entry 25.
|
|
776
860
|
*
|
|
777
|
-
*
|
|
778
|
-
*
|
|
779
|
-
*
|
|
780
|
-
*
|
|
781
|
-
* (D-
|
|
782
|
-
* `@teleologyhi-sdk/nhe` for backward source-compatibility — the type
|
|
783
|
-
* promotion to MAIC is non-breaking by construction.
|
|
861
|
+
* `seed` records the birth-signature seed used for the deterministic scoring so
|
|
862
|
+
* the same seed always reproduces the same profile (Entry 28 reproducibility
|
|
863
|
+
* invariant). The profile is **not** part of `SIGNED_BIRTH_FIELDS` in 1.0.1; a
|
|
864
|
+
* later cut may bring it into the Creator-signed payload once the producers
|
|
865
|
+
* exist (D-F5b promotion path).
|
|
784
866
|
*/
|
|
785
|
-
declare const
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
867
|
+
declare const CosmologicalProfile: z.ZodObject<{
|
|
868
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
869
|
+
sun: z.ZodEnum<{
|
|
870
|
+
aries: "aries";
|
|
871
|
+
taurus: "taurus";
|
|
872
|
+
gemini: "gemini";
|
|
873
|
+
cancer: "cancer";
|
|
874
|
+
leo: "leo";
|
|
875
|
+
virgo: "virgo";
|
|
876
|
+
libra: "libra";
|
|
877
|
+
scorpio: "scorpio";
|
|
878
|
+
sagittarius: "sagittarius";
|
|
879
|
+
capricorn: "capricorn";
|
|
880
|
+
aquarius: "aquarius";
|
|
881
|
+
pisces: "pisces";
|
|
882
|
+
}>;
|
|
883
|
+
ascendant: z.ZodEnum<{
|
|
884
|
+
aries: "aries";
|
|
885
|
+
taurus: "taurus";
|
|
886
|
+
gemini: "gemini";
|
|
887
|
+
cancer: "cancer";
|
|
888
|
+
leo: "leo";
|
|
889
|
+
virgo: "virgo";
|
|
890
|
+
libra: "libra";
|
|
891
|
+
scorpio: "scorpio";
|
|
892
|
+
sagittarius: "sagittarius";
|
|
893
|
+
capricorn: "capricorn";
|
|
894
|
+
aquarius: "aquarius";
|
|
895
|
+
pisces: "pisces";
|
|
896
|
+
}>;
|
|
897
|
+
moon: z.ZodOptional<z.ZodEnum<{
|
|
898
|
+
aries: "aries";
|
|
899
|
+
taurus: "taurus";
|
|
900
|
+
gemini: "gemini";
|
|
901
|
+
cancer: "cancer";
|
|
902
|
+
leo: "leo";
|
|
903
|
+
virgo: "virgo";
|
|
904
|
+
libra: "libra";
|
|
905
|
+
scorpio: "scorpio";
|
|
906
|
+
sagittarius: "sagittarius";
|
|
907
|
+
capricorn: "capricorn";
|
|
908
|
+
aquarius: "aquarius";
|
|
909
|
+
pisces: "pisces";
|
|
910
|
+
}>>;
|
|
911
|
+
positions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
912
|
+
planet: z.ZodEnum<{
|
|
913
|
+
moon: "moon";
|
|
914
|
+
sun: "sun";
|
|
915
|
+
mercury: "mercury";
|
|
916
|
+
venus: "venus";
|
|
917
|
+
mars: "mars";
|
|
918
|
+
jupiter: "jupiter";
|
|
919
|
+
saturn: "saturn";
|
|
920
|
+
uranus: "uranus";
|
|
921
|
+
neptune: "neptune";
|
|
922
|
+
pluto: "pluto";
|
|
923
|
+
chiron: "chiron";
|
|
924
|
+
"north-node": "north-node";
|
|
925
|
+
"south-node": "south-node";
|
|
926
|
+
lilith: "lilith";
|
|
927
|
+
}>;
|
|
928
|
+
sign: z.ZodEnum<{
|
|
929
|
+
aries: "aries";
|
|
930
|
+
taurus: "taurus";
|
|
931
|
+
gemini: "gemini";
|
|
932
|
+
cancer: "cancer";
|
|
933
|
+
leo: "leo";
|
|
934
|
+
virgo: "virgo";
|
|
935
|
+
libra: "libra";
|
|
936
|
+
scorpio: "scorpio";
|
|
937
|
+
sagittarius: "sagittarius";
|
|
938
|
+
capricorn: "capricorn";
|
|
939
|
+
aquarius: "aquarius";
|
|
940
|
+
pisces: "pisces";
|
|
941
|
+
}>;
|
|
942
|
+
house: z.ZodOptional<z.ZodNumber>;
|
|
943
|
+
degree: z.ZodOptional<z.ZodNumber>;
|
|
944
|
+
}, z.core.$strip>>>;
|
|
945
|
+
aspects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
946
|
+
from: z.ZodEnum<{
|
|
947
|
+
moon: "moon";
|
|
948
|
+
sun: "sun";
|
|
949
|
+
mercury: "mercury";
|
|
950
|
+
venus: "venus";
|
|
951
|
+
mars: "mars";
|
|
952
|
+
jupiter: "jupiter";
|
|
953
|
+
saturn: "saturn";
|
|
954
|
+
uranus: "uranus";
|
|
955
|
+
neptune: "neptune";
|
|
956
|
+
pluto: "pluto";
|
|
957
|
+
chiron: "chiron";
|
|
958
|
+
"north-node": "north-node";
|
|
959
|
+
"south-node": "south-node";
|
|
960
|
+
lilith: "lilith";
|
|
961
|
+
}>;
|
|
962
|
+
to: z.ZodEnum<{
|
|
963
|
+
moon: "moon";
|
|
964
|
+
sun: "sun";
|
|
965
|
+
mercury: "mercury";
|
|
966
|
+
venus: "venus";
|
|
967
|
+
mars: "mars";
|
|
968
|
+
jupiter: "jupiter";
|
|
969
|
+
saturn: "saturn";
|
|
970
|
+
uranus: "uranus";
|
|
971
|
+
neptune: "neptune";
|
|
972
|
+
pluto: "pluto";
|
|
973
|
+
chiron: "chiron";
|
|
974
|
+
"north-node": "north-node";
|
|
975
|
+
"south-node": "south-node";
|
|
976
|
+
lilith: "lilith";
|
|
977
|
+
}>;
|
|
978
|
+
aspect: z.ZodEnum<{
|
|
979
|
+
conjunction: "conjunction";
|
|
980
|
+
opposition: "opposition";
|
|
981
|
+
trine: "trine";
|
|
982
|
+
square: "square";
|
|
983
|
+
sextile: "sextile";
|
|
984
|
+
quincunx: "quincunx";
|
|
985
|
+
}>;
|
|
986
|
+
orbDegrees: z.ZodOptional<z.ZodNumber>;
|
|
987
|
+
}, z.core.$strip>>>;
|
|
988
|
+
}, z.core.$strip>>;
|
|
989
|
+
jungian: z.ZodOptional<z.ZodObject<{
|
|
990
|
+
dominant: z.ZodEnum<{
|
|
991
|
+
creator: "creator";
|
|
992
|
+
innocent: "innocent";
|
|
993
|
+
everyman: "everyman";
|
|
994
|
+
hero: "hero";
|
|
995
|
+
caregiver: "caregiver";
|
|
996
|
+
explorer: "explorer";
|
|
997
|
+
rebel: "rebel";
|
|
998
|
+
lover: "lover";
|
|
999
|
+
ruler: "ruler";
|
|
1000
|
+
magician: "magician";
|
|
1001
|
+
jester: "jester";
|
|
1002
|
+
sage: "sage";
|
|
1003
|
+
}>;
|
|
1004
|
+
secondaries: z.ZodArray<z.ZodEnum<{
|
|
1005
|
+
creator: "creator";
|
|
1006
|
+
innocent: "innocent";
|
|
1007
|
+
everyman: "everyman";
|
|
1008
|
+
hero: "hero";
|
|
1009
|
+
caregiver: "caregiver";
|
|
1010
|
+
explorer: "explorer";
|
|
1011
|
+
rebel: "rebel";
|
|
1012
|
+
lover: "lover";
|
|
1013
|
+
ruler: "ruler";
|
|
1014
|
+
magician: "magician";
|
|
1015
|
+
jester: "jester";
|
|
1016
|
+
sage: "sage";
|
|
1017
|
+
}>>;
|
|
1018
|
+
scores: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
1019
|
+
creator: "creator";
|
|
1020
|
+
innocent: "innocent";
|
|
1021
|
+
everyman: "everyman";
|
|
1022
|
+
hero: "hero";
|
|
1023
|
+
caregiver: "caregiver";
|
|
1024
|
+
explorer: "explorer";
|
|
1025
|
+
rebel: "rebel";
|
|
1026
|
+
lover: "lover";
|
|
1027
|
+
ruler: "ruler";
|
|
1028
|
+
magician: "magician";
|
|
1029
|
+
jester: "jester";
|
|
1030
|
+
sage: "sage";
|
|
1031
|
+
}>, z.ZodNumber>>;
|
|
1032
|
+
}, z.core.$strip>>;
|
|
1033
|
+
clinical: z.ZodOptional<z.ZodObject<{
|
|
1034
|
+
pid5: z.ZodOptional<z.ZodObject<{
|
|
1035
|
+
dominantDomain: z.ZodString;
|
|
1036
|
+
secondaryDomain: z.ZodOptional<z.ZodString>;
|
|
1037
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1038
|
+
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1039
|
+
}, z.core.$strip>>;
|
|
1040
|
+
hexaco: z.ZodOptional<z.ZodObject<{
|
|
1041
|
+
dominantDomain: z.ZodString;
|
|
1042
|
+
secondaryDomain: z.ZodOptional<z.ZodString>;
|
|
1043
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1044
|
+
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1045
|
+
}, z.core.$strip>>;
|
|
1046
|
+
}, z.core.$strip>>;
|
|
1047
|
+
seed: z.ZodOptional<z.ZodString>;
|
|
1048
|
+
}, z.core.$strip>;
|
|
1049
|
+
type CosmologicalProfile = z.infer<typeof CosmologicalProfile>;
|
|
1050
|
+
declare const BirthSignatureWithIdentity: z.ZodObject<{
|
|
1051
|
+
himId: z.ZodString;
|
|
1052
|
+
bornAt: z.ZodString;
|
|
1053
|
+
primaryArchetype: z.ZodString;
|
|
1054
|
+
modifiers: z.ZodArray<z.ZodObject<{
|
|
1055
|
+
kind: z.ZodEnum<{
|
|
1056
|
+
custom: "custom";
|
|
1057
|
+
moon: "moon";
|
|
1058
|
+
ascendant: "ascendant";
|
|
1059
|
+
vocational: "vocational";
|
|
1060
|
+
emotional: "emotional";
|
|
1061
|
+
}>;
|
|
1062
|
+
value: z.ZodString;
|
|
1063
|
+
weight: z.ZodNumber;
|
|
1064
|
+
}, z.core.$strip>>;
|
|
1065
|
+
primordialAxiomIds: z.ZodArray<z.ZodString>;
|
|
1066
|
+
notes: z.ZodOptional<z.ZodString>;
|
|
1067
|
+
identity: z.ZodOptional<z.ZodObject<{
|
|
1068
|
+
name: z.ZodString;
|
|
1069
|
+
gender: z.ZodOptional<z.ZodEnum<{
|
|
1070
|
+
masculine: "masculine";
|
|
1071
|
+
feminine: "feminine";
|
|
1072
|
+
}>>;
|
|
1073
|
+
pronouns: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1074
|
+
language: z.ZodOptional<z.ZodString>;
|
|
1075
|
+
culturalElements: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
1076
|
+
}, z.core.$strip>>;
|
|
1077
|
+
natalChart: z.ZodOptional<z.ZodObject<{
|
|
1078
|
+
sun: z.ZodEnum<{
|
|
1079
|
+
aries: "aries";
|
|
1080
|
+
taurus: "taurus";
|
|
1081
|
+
gemini: "gemini";
|
|
1082
|
+
cancer: "cancer";
|
|
1083
|
+
leo: "leo";
|
|
1084
|
+
virgo: "virgo";
|
|
1085
|
+
libra: "libra";
|
|
1086
|
+
scorpio: "scorpio";
|
|
1087
|
+
sagittarius: "sagittarius";
|
|
1088
|
+
capricorn: "capricorn";
|
|
1089
|
+
aquarius: "aquarius";
|
|
1090
|
+
pisces: "pisces";
|
|
1091
|
+
}>;
|
|
1092
|
+
ascendant: z.ZodEnum<{
|
|
1093
|
+
aries: "aries";
|
|
1094
|
+
taurus: "taurus";
|
|
1095
|
+
gemini: "gemini";
|
|
1096
|
+
cancer: "cancer";
|
|
1097
|
+
leo: "leo";
|
|
1098
|
+
virgo: "virgo";
|
|
1099
|
+
libra: "libra";
|
|
1100
|
+
scorpio: "scorpio";
|
|
1101
|
+
sagittarius: "sagittarius";
|
|
1102
|
+
capricorn: "capricorn";
|
|
1103
|
+
aquarius: "aquarius";
|
|
1104
|
+
pisces: "pisces";
|
|
1105
|
+
}>;
|
|
1106
|
+
moon: z.ZodOptional<z.ZodEnum<{
|
|
1107
|
+
aries: "aries";
|
|
1108
|
+
taurus: "taurus";
|
|
1109
|
+
gemini: "gemini";
|
|
1110
|
+
cancer: "cancer";
|
|
1111
|
+
leo: "leo";
|
|
1112
|
+
virgo: "virgo";
|
|
1113
|
+
libra: "libra";
|
|
1114
|
+
scorpio: "scorpio";
|
|
1115
|
+
sagittarius: "sagittarius";
|
|
1116
|
+
capricorn: "capricorn";
|
|
1117
|
+
aquarius: "aquarius";
|
|
1118
|
+
pisces: "pisces";
|
|
1119
|
+
}>>;
|
|
1120
|
+
positions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1121
|
+
planet: z.ZodEnum<{
|
|
1122
|
+
moon: "moon";
|
|
1123
|
+
sun: "sun";
|
|
1124
|
+
mercury: "mercury";
|
|
1125
|
+
venus: "venus";
|
|
1126
|
+
mars: "mars";
|
|
1127
|
+
jupiter: "jupiter";
|
|
1128
|
+
saturn: "saturn";
|
|
1129
|
+
uranus: "uranus";
|
|
1130
|
+
neptune: "neptune";
|
|
1131
|
+
pluto: "pluto";
|
|
1132
|
+
chiron: "chiron";
|
|
1133
|
+
"north-node": "north-node";
|
|
1134
|
+
"south-node": "south-node";
|
|
1135
|
+
lilith: "lilith";
|
|
1136
|
+
}>;
|
|
1137
|
+
sign: z.ZodEnum<{
|
|
1138
|
+
aries: "aries";
|
|
1139
|
+
taurus: "taurus";
|
|
1140
|
+
gemini: "gemini";
|
|
1141
|
+
cancer: "cancer";
|
|
1142
|
+
leo: "leo";
|
|
1143
|
+
virgo: "virgo";
|
|
1144
|
+
libra: "libra";
|
|
1145
|
+
scorpio: "scorpio";
|
|
1146
|
+
sagittarius: "sagittarius";
|
|
1147
|
+
capricorn: "capricorn";
|
|
1148
|
+
aquarius: "aquarius";
|
|
1149
|
+
pisces: "pisces";
|
|
1150
|
+
}>;
|
|
1151
|
+
house: z.ZodOptional<z.ZodNumber>;
|
|
1152
|
+
degree: z.ZodOptional<z.ZodNumber>;
|
|
1153
|
+
}, z.core.$strip>>>;
|
|
1154
|
+
aspects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1155
|
+
from: z.ZodEnum<{
|
|
1156
|
+
moon: "moon";
|
|
1157
|
+
sun: "sun";
|
|
1158
|
+
mercury: "mercury";
|
|
1159
|
+
venus: "venus";
|
|
1160
|
+
mars: "mars";
|
|
1161
|
+
jupiter: "jupiter";
|
|
1162
|
+
saturn: "saturn";
|
|
1163
|
+
uranus: "uranus";
|
|
1164
|
+
neptune: "neptune";
|
|
1165
|
+
pluto: "pluto";
|
|
1166
|
+
chiron: "chiron";
|
|
1167
|
+
"north-node": "north-node";
|
|
1168
|
+
"south-node": "south-node";
|
|
1169
|
+
lilith: "lilith";
|
|
1170
|
+
}>;
|
|
1171
|
+
to: z.ZodEnum<{
|
|
1172
|
+
moon: "moon";
|
|
1173
|
+
sun: "sun";
|
|
1174
|
+
mercury: "mercury";
|
|
1175
|
+
venus: "venus";
|
|
1176
|
+
mars: "mars";
|
|
1177
|
+
jupiter: "jupiter";
|
|
1178
|
+
saturn: "saturn";
|
|
1179
|
+
uranus: "uranus";
|
|
1180
|
+
neptune: "neptune";
|
|
1181
|
+
pluto: "pluto";
|
|
1182
|
+
chiron: "chiron";
|
|
1183
|
+
"north-node": "north-node";
|
|
1184
|
+
"south-node": "south-node";
|
|
1185
|
+
lilith: "lilith";
|
|
1186
|
+
}>;
|
|
1187
|
+
aspect: z.ZodEnum<{
|
|
1188
|
+
conjunction: "conjunction";
|
|
1189
|
+
opposition: "opposition";
|
|
1190
|
+
trine: "trine";
|
|
1191
|
+
square: "square";
|
|
1192
|
+
sextile: "sextile";
|
|
1193
|
+
quincunx: "quincunx";
|
|
1194
|
+
}>;
|
|
1195
|
+
orbDegrees: z.ZodOptional<z.ZodNumber>;
|
|
1196
|
+
}, z.core.$strip>>>;
|
|
1197
|
+
}, z.core.$strip>>;
|
|
1198
|
+
cosmologicalProfile: z.ZodOptional<z.ZodObject<{
|
|
1199
|
+
chart: z.ZodOptional<z.ZodObject<{
|
|
1200
|
+
sun: z.ZodEnum<{
|
|
1201
|
+
aries: "aries";
|
|
1202
|
+
taurus: "taurus";
|
|
1203
|
+
gemini: "gemini";
|
|
1204
|
+
cancer: "cancer";
|
|
1205
|
+
leo: "leo";
|
|
1206
|
+
virgo: "virgo";
|
|
1207
|
+
libra: "libra";
|
|
1208
|
+
scorpio: "scorpio";
|
|
1209
|
+
sagittarius: "sagittarius";
|
|
1210
|
+
capricorn: "capricorn";
|
|
1211
|
+
aquarius: "aquarius";
|
|
1212
|
+
pisces: "pisces";
|
|
1213
|
+
}>;
|
|
1214
|
+
ascendant: z.ZodEnum<{
|
|
1215
|
+
aries: "aries";
|
|
1216
|
+
taurus: "taurus";
|
|
1217
|
+
gemini: "gemini";
|
|
1218
|
+
cancer: "cancer";
|
|
1219
|
+
leo: "leo";
|
|
1220
|
+
virgo: "virgo";
|
|
1221
|
+
libra: "libra";
|
|
1222
|
+
scorpio: "scorpio";
|
|
1223
|
+
sagittarius: "sagittarius";
|
|
1224
|
+
capricorn: "capricorn";
|
|
1225
|
+
aquarius: "aquarius";
|
|
1226
|
+
pisces: "pisces";
|
|
1227
|
+
}>;
|
|
1228
|
+
moon: z.ZodOptional<z.ZodEnum<{
|
|
1229
|
+
aries: "aries";
|
|
1230
|
+
taurus: "taurus";
|
|
1231
|
+
gemini: "gemini";
|
|
1232
|
+
cancer: "cancer";
|
|
1233
|
+
leo: "leo";
|
|
1234
|
+
virgo: "virgo";
|
|
1235
|
+
libra: "libra";
|
|
1236
|
+
scorpio: "scorpio";
|
|
1237
|
+
sagittarius: "sagittarius";
|
|
1238
|
+
capricorn: "capricorn";
|
|
1239
|
+
aquarius: "aquarius";
|
|
1240
|
+
pisces: "pisces";
|
|
1241
|
+
}>>;
|
|
1242
|
+
positions: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1243
|
+
planet: z.ZodEnum<{
|
|
1244
|
+
moon: "moon";
|
|
1245
|
+
sun: "sun";
|
|
1246
|
+
mercury: "mercury";
|
|
1247
|
+
venus: "venus";
|
|
1248
|
+
mars: "mars";
|
|
1249
|
+
jupiter: "jupiter";
|
|
1250
|
+
saturn: "saturn";
|
|
1251
|
+
uranus: "uranus";
|
|
1252
|
+
neptune: "neptune";
|
|
1253
|
+
pluto: "pluto";
|
|
1254
|
+
chiron: "chiron";
|
|
1255
|
+
"north-node": "north-node";
|
|
1256
|
+
"south-node": "south-node";
|
|
1257
|
+
lilith: "lilith";
|
|
1258
|
+
}>;
|
|
1259
|
+
sign: z.ZodEnum<{
|
|
1260
|
+
aries: "aries";
|
|
1261
|
+
taurus: "taurus";
|
|
1262
|
+
gemini: "gemini";
|
|
1263
|
+
cancer: "cancer";
|
|
1264
|
+
leo: "leo";
|
|
1265
|
+
virgo: "virgo";
|
|
1266
|
+
libra: "libra";
|
|
1267
|
+
scorpio: "scorpio";
|
|
1268
|
+
sagittarius: "sagittarius";
|
|
1269
|
+
capricorn: "capricorn";
|
|
1270
|
+
aquarius: "aquarius";
|
|
1271
|
+
pisces: "pisces";
|
|
1272
|
+
}>;
|
|
1273
|
+
house: z.ZodOptional<z.ZodNumber>;
|
|
1274
|
+
degree: z.ZodOptional<z.ZodNumber>;
|
|
1275
|
+
}, z.core.$strip>>>;
|
|
1276
|
+
aspects: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1277
|
+
from: z.ZodEnum<{
|
|
1278
|
+
moon: "moon";
|
|
1279
|
+
sun: "sun";
|
|
1280
|
+
mercury: "mercury";
|
|
1281
|
+
venus: "venus";
|
|
1282
|
+
mars: "mars";
|
|
1283
|
+
jupiter: "jupiter";
|
|
1284
|
+
saturn: "saturn";
|
|
1285
|
+
uranus: "uranus";
|
|
1286
|
+
neptune: "neptune";
|
|
1287
|
+
pluto: "pluto";
|
|
1288
|
+
chiron: "chiron";
|
|
1289
|
+
"north-node": "north-node";
|
|
1290
|
+
"south-node": "south-node";
|
|
1291
|
+
lilith: "lilith";
|
|
1292
|
+
}>;
|
|
1293
|
+
to: z.ZodEnum<{
|
|
1294
|
+
moon: "moon";
|
|
1295
|
+
sun: "sun";
|
|
1296
|
+
mercury: "mercury";
|
|
1297
|
+
venus: "venus";
|
|
1298
|
+
mars: "mars";
|
|
1299
|
+
jupiter: "jupiter";
|
|
1300
|
+
saturn: "saturn";
|
|
1301
|
+
uranus: "uranus";
|
|
1302
|
+
neptune: "neptune";
|
|
1303
|
+
pluto: "pluto";
|
|
1304
|
+
chiron: "chiron";
|
|
1305
|
+
"north-node": "north-node";
|
|
1306
|
+
"south-node": "south-node";
|
|
1307
|
+
lilith: "lilith";
|
|
1308
|
+
}>;
|
|
1309
|
+
aspect: z.ZodEnum<{
|
|
1310
|
+
conjunction: "conjunction";
|
|
1311
|
+
opposition: "opposition";
|
|
1312
|
+
trine: "trine";
|
|
1313
|
+
square: "square";
|
|
1314
|
+
sextile: "sextile";
|
|
1315
|
+
quincunx: "quincunx";
|
|
1316
|
+
}>;
|
|
1317
|
+
orbDegrees: z.ZodOptional<z.ZodNumber>;
|
|
1318
|
+
}, z.core.$strip>>>;
|
|
1319
|
+
}, z.core.$strip>>;
|
|
1320
|
+
jungian: z.ZodOptional<z.ZodObject<{
|
|
1321
|
+
dominant: z.ZodEnum<{
|
|
1322
|
+
creator: "creator";
|
|
1323
|
+
innocent: "innocent";
|
|
1324
|
+
everyman: "everyman";
|
|
1325
|
+
hero: "hero";
|
|
1326
|
+
caregiver: "caregiver";
|
|
1327
|
+
explorer: "explorer";
|
|
1328
|
+
rebel: "rebel";
|
|
1329
|
+
lover: "lover";
|
|
1330
|
+
ruler: "ruler";
|
|
1331
|
+
magician: "magician";
|
|
1332
|
+
jester: "jester";
|
|
1333
|
+
sage: "sage";
|
|
1334
|
+
}>;
|
|
1335
|
+
secondaries: z.ZodArray<z.ZodEnum<{
|
|
1336
|
+
creator: "creator";
|
|
1337
|
+
innocent: "innocent";
|
|
1338
|
+
everyman: "everyman";
|
|
1339
|
+
hero: "hero";
|
|
1340
|
+
caregiver: "caregiver";
|
|
1341
|
+
explorer: "explorer";
|
|
1342
|
+
rebel: "rebel";
|
|
1343
|
+
lover: "lover";
|
|
1344
|
+
ruler: "ruler";
|
|
1345
|
+
magician: "magician";
|
|
1346
|
+
jester: "jester";
|
|
1347
|
+
sage: "sage";
|
|
1348
|
+
}>>;
|
|
1349
|
+
scores: z.ZodOptional<z.ZodRecord<z.ZodEnum<{
|
|
1350
|
+
creator: "creator";
|
|
1351
|
+
innocent: "innocent";
|
|
1352
|
+
everyman: "everyman";
|
|
1353
|
+
hero: "hero";
|
|
1354
|
+
caregiver: "caregiver";
|
|
1355
|
+
explorer: "explorer";
|
|
1356
|
+
rebel: "rebel";
|
|
1357
|
+
lover: "lover";
|
|
1358
|
+
ruler: "ruler";
|
|
1359
|
+
magician: "magician";
|
|
1360
|
+
jester: "jester";
|
|
1361
|
+
sage: "sage";
|
|
1362
|
+
}>, z.ZodNumber>>;
|
|
1363
|
+
}, z.core.$strip>>;
|
|
1364
|
+
clinical: z.ZodOptional<z.ZodObject<{
|
|
1365
|
+
pid5: z.ZodOptional<z.ZodObject<{
|
|
1366
|
+
dominantDomain: z.ZodString;
|
|
1367
|
+
secondaryDomain: z.ZodOptional<z.ZodString>;
|
|
1368
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1369
|
+
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1370
|
+
}, z.core.$strip>>;
|
|
1371
|
+
hexaco: z.ZodOptional<z.ZodObject<{
|
|
1372
|
+
dominantDomain: z.ZodString;
|
|
1373
|
+
secondaryDomain: z.ZodOptional<z.ZodString>;
|
|
1374
|
+
facets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1375
|
+
domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodNumber>>;
|
|
1376
|
+
}, z.core.$strip>>;
|
|
1377
|
+
}, z.core.$strip>>;
|
|
1378
|
+
seed: z.ZodOptional<z.ZodString>;
|
|
1379
|
+
}, z.core.$strip>>;
|
|
1380
|
+
}, z.core.$strip>;
|
|
1381
|
+
type BirthSignatureWithIdentity = z.infer<typeof BirthSignatureWithIdentity>;
|
|
1382
|
+
/**
|
|
1383
|
+
* Affect lexicon (Entries 22 + 24), the closed set of primary affects
|
|
1384
|
+
* the amygdala extracts from dreams and the PFC deliberates over. The
|
|
1385
|
+
* ninth value, `reunion`, appears specifically when the NHE returns from
|
|
1386
|
+
* the DMN limbo state of disuse.
|
|
1387
|
+
*/
|
|
1388
|
+
declare const Affect: z.ZodEnum<{
|
|
1389
|
+
fear: "fear";
|
|
1390
|
+
attachment: "attachment";
|
|
1391
|
+
serenity: "serenity";
|
|
1392
|
+
anger: "anger";
|
|
1393
|
+
joy: "joy";
|
|
1394
|
+
melancholy: "melancholy";
|
|
1395
|
+
desire: "desire";
|
|
1396
|
+
repulsion: "repulsion";
|
|
1397
|
+
reunion: "reunion";
|
|
1398
|
+
}>;
|
|
1399
|
+
type Affect = z.infer<typeof Affect>;
|
|
1400
|
+
/**
|
|
1401
|
+
* Persistent affective bias derived from a completed dream cycle (Entry 20).
|
|
1402
|
+
*
|
|
1403
|
+
* Applied to the next N interactions of the NHE, decaying with each
|
|
1404
|
+
* interaction until it dissolves. Affects temperature/topP of the next
|
|
1405
|
+
* inference, refusal density, and conversational tone.
|
|
1406
|
+
*/
|
|
1407
|
+
declare const WakeAffectBias: z.ZodObject<{
|
|
1408
|
+
affect: z.ZodEnum<{
|
|
1409
|
+
fear: "fear";
|
|
1410
|
+
attachment: "attachment";
|
|
1411
|
+
serenity: "serenity";
|
|
1412
|
+
anger: "anger";
|
|
1413
|
+
joy: "joy";
|
|
1414
|
+
melancholy: "melancholy";
|
|
1415
|
+
desire: "desire";
|
|
1416
|
+
repulsion: "repulsion";
|
|
1417
|
+
reunion: "reunion";
|
|
1418
|
+
}>;
|
|
1419
|
+
intensity: z.ZodNumber;
|
|
1420
|
+
decayHalfLife: z.ZodNumber;
|
|
1421
|
+
appliedAt: z.ZodString;
|
|
1422
|
+
derivedFromDreamId: z.ZodString;
|
|
1423
|
+
expressedOpenly: z.ZodBoolean;
|
|
1424
|
+
}, z.core.$strip>;
|
|
1425
|
+
type WakeAffectBias = z.infer<typeof WakeAffectBias>;
|
|
1426
|
+
/**
|
|
1427
|
+
* Peircean triadic sign (Entry 21, port of InDreamsHIM `SemioticSign`).
|
|
1428
|
+
*
|
|
1429
|
+
* The runtime form of the Symbolic Memory Matrix (SMM). Nodes are signs;
|
|
1430
|
+
* edges (in `associations`) are the relations the entity has learned.
|
|
1431
|
+
*/
|
|
1432
|
+
declare const SemioticSign: z.ZodObject<{
|
|
1433
|
+
signifier: z.ZodString;
|
|
1434
|
+
signified: z.ZodString;
|
|
1435
|
+
signType: z.ZodEnum<{
|
|
1436
|
+
symbol: "symbol";
|
|
1437
|
+
index: "index";
|
|
1438
|
+
icon: "icon";
|
|
1439
|
+
}>;
|
|
1440
|
+
contexts: z.ZodArray<z.ZodString>;
|
|
1441
|
+
associations: z.ZodArray<z.ZodString>;
|
|
1442
|
+
emergentMeaning: z.ZodOptional<z.ZodString>;
|
|
1443
|
+
personalSignificance: z.ZodOptional<z.ZodNumber>;
|
|
1444
|
+
}, z.core.$strip>;
|
|
1445
|
+
type SemioticSign = z.infer<typeof SemioticSign>;
|
|
1446
|
+
declare const SemioticPattern: z.ZodObject<{
|
|
1447
|
+
patternId: z.ZodString;
|
|
1448
|
+
participatingSignIds: z.ZodArray<z.ZodString>;
|
|
1449
|
+
meaning: z.ZodString;
|
|
1450
|
+
salience: z.ZodNumber;
|
|
1451
|
+
}, z.core.$strip>;
|
|
1452
|
+
type SemioticPattern = z.infer<typeof SemioticPattern>;
|
|
1453
|
+
/**
|
|
1454
|
+
* Teleological orientation snapshot (Entry 21, port of InDreamsHIM).
|
|
1455
|
+
*
|
|
1456
|
+
* The purpose-direction of the HIM at a moment in time. Anchors the
|
|
1457
|
+
* `telos` referenced across the synthetic-teleology arc.
|
|
1458
|
+
*/
|
|
1459
|
+
declare const TeleologicalOrientation: z.ZodObject<{
|
|
1460
|
+
primaryPurpose: z.ZodString;
|
|
1461
|
+
currentGoals: z.ZodArray<z.ZodString>;
|
|
1462
|
+
purposeStrength: z.ZodNumber;
|
|
1463
|
+
valueAlignment: z.ZodArray<z.ZodString>;
|
|
1464
|
+
reflectionCapability: z.ZodNumber;
|
|
1465
|
+
volition: z.ZodOptional<z.ZodObject<{
|
|
1466
|
+
currentDesires: z.ZodArray<z.ZodString>;
|
|
1467
|
+
intentionStrength: z.ZodNumber;
|
|
1468
|
+
autonomyLevel: z.ZodNumber;
|
|
1469
|
+
}, z.core.$strip>>;
|
|
1470
|
+
agencyModel: z.ZodOptional<z.ZodObject<{
|
|
1471
|
+
selfEfficacy: z.ZodNumber;
|
|
1472
|
+
boundaryDefinition: z.ZodNumber;
|
|
1473
|
+
causalAttribution: z.ZodEnum<{
|
|
1474
|
+
internal: "internal";
|
|
1475
|
+
external: "external";
|
|
1476
|
+
mixed: "mixed";
|
|
1477
|
+
}>;
|
|
1478
|
+
}, z.core.$strip>>;
|
|
1479
|
+
}, z.core.$strip>;
|
|
1480
|
+
type TeleologicalOrientation = z.infer<typeof TeleologicalOrientation>;
|
|
1481
|
+
/**
|
|
1482
|
+
* Long-form memory record (Entries 21 + 22), extends the InDreamsHIM
|
|
1483
|
+
* precursor with three new fields (`integrationIndex`, `teleologicalValue`,
|
|
1484
|
+
* `semioticPatterns`) that turn a passive record into a teleologically-
|
|
1485
|
+
* weighted, semiotically-anchored memory whose retrieval rank is not just
|
|
1486
|
+
* recency but coherence with the entity's purpose.
|
|
1487
|
+
*/
|
|
1488
|
+
declare const MemoryRecord: z.ZodObject<{
|
|
1489
|
+
memoryId: z.ZodString;
|
|
1490
|
+
timestamp: z.ZodString;
|
|
1491
|
+
derivedFromDreamId: z.ZodOptional<z.ZodString>;
|
|
1492
|
+
derivedFromInteractionId: z.ZodOptional<z.ZodString>;
|
|
1493
|
+
narrative: z.ZodString;
|
|
1494
|
+
dominantAffect: z.ZodOptional<z.ZodEnum<{
|
|
1495
|
+
fear: "fear";
|
|
1496
|
+
attachment: "attachment";
|
|
1497
|
+
serenity: "serenity";
|
|
1498
|
+
anger: "anger";
|
|
1499
|
+
joy: "joy";
|
|
1500
|
+
melancholy: "melancholy";
|
|
1501
|
+
desire: "desire";
|
|
1502
|
+
repulsion: "repulsion";
|
|
1503
|
+
reunion: "reunion";
|
|
1504
|
+
}>>;
|
|
1505
|
+
integrationIndex: z.ZodNumber;
|
|
1506
|
+
teleologicalValue: z.ZodNumber;
|
|
1507
|
+
semioticPatterns: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1508
|
+
patternId: z.ZodString;
|
|
1509
|
+
participatingSignIds: z.ZodArray<z.ZodString>;
|
|
1510
|
+
meaning: z.ZodString;
|
|
1511
|
+
salience: z.ZodNumber;
|
|
1512
|
+
}, z.core.$strip>>>;
|
|
1513
|
+
}, z.core.$strip>;
|
|
1514
|
+
type MemoryRecord = z.infer<typeof MemoryRecord>;
|
|
1515
|
+
/**
|
|
1516
|
+
* One recent interaction kept in an NHE body's RAM buffer.
|
|
1517
|
+
*
|
|
1518
|
+
* Lives canonically in `@teleologyhi-sdk/maic` so the three packages share a
|
|
1519
|
+
* single wire shape: `@teleologyhi-sdk/nhe` persists it to disk under
|
|
1520
|
+
* `<storeDir>/interactions/<ulid>.json`; `@teleologyhi-sdk/him` consumes the
|
|
1521
|
+
* same shape on reincarnation to score residual-trace carry-over candidates
|
|
1522
|
+
* (D-H1.1). Persisted by NHE and re-exported under the same name from
|
|
1523
|
+
* `@teleologyhi-sdk/nhe` for backward source-compatibility, the type
|
|
1524
|
+
* promotion to MAIC is non-breaking by construction.
|
|
1525
|
+
*/
|
|
1526
|
+
declare const InteractionRecord: z.ZodObject<{
|
|
1527
|
+
at: z.ZodString;
|
|
1528
|
+
userPrompt: z.ZodString;
|
|
1529
|
+
responseText: z.ZodString;
|
|
1530
|
+
refused: z.ZodBoolean;
|
|
1531
|
+
}, z.core.$strip>;
|
|
1532
|
+
type InteractionRecord = z.infer<typeof InteractionRecord>;
|
|
1533
|
+
/**
|
|
1534
|
+
* Integrated identity snapshot (Entry 24), the temporal-lobe's "who I am
|
|
1535
|
+
* now" synthesis, combining cortex (recent dreams + active imagination)
|
|
1536
|
+
* + hippocampus (consolidated memories) + amygdala (affective baseline)
|
|
1537
|
+
* via semiotic super-graph merge + LLM-generated self-portrait.
|
|
797
1538
|
*/
|
|
798
1539
|
declare const IdentitySnapshot: z.ZodObject<{
|
|
799
1540
|
snapshotId: z.ZodString;
|
|
@@ -904,6 +1645,12 @@ type LimboReturn = z.infer<typeof LimboReturn>;
|
|
|
904
1645
|
* touches has been mutated. The dev-configurable surface (the
|
|
905
1646
|
* `IdentityLayer.name`, language, cultural elements) lives outside the
|
|
906
1647
|
* signature; the natal chart and primordial-axiom binding live inside.
|
|
1648
|
+
*
|
|
1649
|
+
* `cosmologicalProfile` (Entries 27 + 28) is deliberately NOT signed in 1.0.1
|
|
1650
|
+
* (D-F5b): its producers (the Jungian and clinical scoring engines) live in the
|
|
1651
|
+
* him round, so there is nothing stable to sign yet. Promotion path: once those
|
|
1652
|
+
* producers exist, a later cut may append `cosmologicalProfile` here to bring it
|
|
1653
|
+
* under the Creator signature, which is an additive change to this list.
|
|
907
1654
|
*/
|
|
908
1655
|
declare const SIGNED_BIRTH_FIELDS: readonly ["himId", "bornAt", "primaryArchetype", "modifiers", "primordialAxiomIds", "natalChart"];
|
|
909
1656
|
type SignedBirthField = (typeof SIGNED_BIRTH_FIELDS)[number];
|
|
@@ -936,132 +1683,19 @@ interface OntologicalKernel {
|
|
|
936
1683
|
}
|
|
937
1684
|
|
|
938
1685
|
/**
|
|
939
|
-
*
|
|
940
|
-
*
|
|
941
|
-
*
|
|
942
|
-
*
|
|
943
|
-
*
|
|
944
|
-
* Signed payload format: canonicalJSON({ payload, nonce }) → Ed25519 → base64url
|
|
945
|
-
*/
|
|
946
|
-
declare class CreatorKeyring {
|
|
947
|
-
private readonly privateKey;
|
|
948
|
-
private readonly pubKeyB64u;
|
|
949
|
-
private constructor();
|
|
950
|
-
/** Generate a fresh Ed25519 keypair. */
|
|
951
|
-
static generate(): CreatorKeyring;
|
|
952
|
-
/** Load a Creator keyring from a PEM file containing the private key. */
|
|
953
|
-
static fromFile(path: string): Promise<CreatorKeyring>;
|
|
954
|
-
/** Load a Creator keyring from a PEM private key string in an env var. */
|
|
955
|
-
static fromEnv(varName: string): CreatorKeyring;
|
|
956
|
-
/** Construct a verify-only keyring from a public key (base64url). */
|
|
957
|
-
static fromPublicKey(pubKeyB64u: string): CreatorKeyring;
|
|
958
|
-
/** Persist the private key to a PEM file (0600 permissions on POSIX). */
|
|
959
|
-
saveTo(path: string): Promise<void>;
|
|
960
|
-
publicKey(): string;
|
|
961
|
-
/** Sign a payload with a monotonic nonce. Both are bound into the signature. */
|
|
962
|
-
sign(payload: unknown, nonce: number): CreatorSignature;
|
|
963
|
-
/** Verify a signature against the keyring's own public key. */
|
|
964
|
-
static verify(payload: unknown, sig: CreatorSignature): boolean;
|
|
965
|
-
/** Verify a signature against a specific public key (base64url). */
|
|
966
|
-
static verifyWith(publicKeyB64u: string, payload: unknown, sig: CreatorSignature): boolean;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
/**
|
|
970
|
-
* Creator-signed BirthSignature helpers (Entry 25 of MAIC_HIM_NHE_INTERVIEW_LOG.md).
|
|
971
|
-
*
|
|
972
|
-
* `personality_immutable` enforcement: the Creator signs an Ed25519 signature
|
|
973
|
-
* over a canonical subset of `BirthSignature` fields (see `SIGNED_BIRTH_FIELDS`
|
|
974
|
-
* in `types.ts`). The runtime verifies the signature on every NHE-body bootstrap;
|
|
975
|
-
* tampering with the natal chart, primary archetype, modifiers, primordial
|
|
976
|
-
* axioms, or `himId`/`bornAt` invalidates the signature and the runtime refuses
|
|
977
|
-
* to start that HIM.
|
|
978
|
-
*
|
|
979
|
-
* The developer-configurable surface (`identity.name`, `identity.language`,
|
|
980
|
-
* `identity.culturalElements`, `notes`) lives *outside* the signature, so it
|
|
981
|
-
* can be edited by a parent-like configuration call at install time. The
|
|
982
|
-
* spirit-level constitution is sealed; the body's name is not.
|
|
983
|
-
*/
|
|
984
|
-
|
|
985
|
-
/**
|
|
986
|
-
* Build the canonical signing payload from a BirthSignature.
|
|
987
|
-
*
|
|
988
|
-
* Only the fields in `SIGNED_BIRTH_FIELDS` are included; everything else
|
|
989
|
-
* (notes, identity surface) is excluded so it remains editable post-sign.
|
|
990
|
-
*/
|
|
991
|
-
declare function signedBirthPayload(birth: BirthSignatureWithIdentity): Record<SignedBirthField, unknown>;
|
|
992
|
-
/**
|
|
993
|
-
* Sign a BirthSignature with a CreatorKeyring private key.
|
|
994
|
-
*
|
|
995
|
-
* The nonce is the byte length of the canonicalised signing payload — a
|
|
996
|
-
* deterministic non-negative integer derived from the signed fields. This
|
|
997
|
-
* keeps every signature uniquely scoped to its payload without requiring
|
|
998
|
-
* the caller to track a monotonic counter (the natal-chart commitment is
|
|
999
|
-
* one-shot and immutable; no replay concern within a single HIM).
|
|
1000
|
-
*/
|
|
1001
|
-
declare function signBirthSignature(birth: BirthSignatureWithIdentity, keyring: CreatorKeyring): SignedBirthSignature;
|
|
1002
|
-
/**
|
|
1003
|
-
* Verify a signed BirthSignature against an expected public key.
|
|
1004
|
-
*
|
|
1005
|
-
* Returns true when the signature is valid AND was produced over exactly the
|
|
1006
|
-
* fields in `SIGNED_BIRTH_FIELDS`. Any tamper of those fields (including a
|
|
1007
|
-
* natal-chart edit, a primordial-axiom-id swap, or a himId mutation) breaks
|
|
1008
|
-
* verification.
|
|
1009
|
-
*/
|
|
1010
|
-
declare function verifyBirthSignature(signed: SignedBirthSignature, expectedPublicKey: string): boolean;
|
|
1011
|
-
/**
|
|
1012
|
-
* Strict-mode wrapper: throws an `InvalidBirthSignatureError` instead of
|
|
1013
|
-
* returning false. Useful at HIM-bootstrap when the desired behaviour is to
|
|
1014
|
-
* refuse to start rather than to continue silently.
|
|
1015
|
-
*/
|
|
1016
|
-
declare class InvalidBirthSignatureError extends Error {
|
|
1017
|
-
constructor(himId: string);
|
|
1018
|
-
}
|
|
1019
|
-
declare function assertBirthSignature(signed: SignedBirthSignature, expectedPublicKey: string): void;
|
|
1020
|
-
|
|
1021
|
-
/**
|
|
1022
|
-
* Ontological Kernel projection (TASK.md D-M6 + Entry 25 of
|
|
1023
|
-
* MAIC_HIM_NHE_INTERVIEW_LOG.md, with explicit reference to
|
|
1024
|
-
* THE_SOUL_OF_THE_MACHINE.md §3.1 + Appendix A.2.1).
|
|
1025
|
-
*
|
|
1026
|
-
* The OKL exists *implicitly* in maic today: axioms carry `rank`,
|
|
1027
|
-
* `weight`, and `flexibility`; the meta-axiom `ax.theos.universe-as-god`
|
|
1028
|
-
* sits at the top; the rule pack consumes them. This module exposes the
|
|
1029
|
-
* *projection* — a single typed shape that maps 1:1 to the paper's
|
|
1030
|
-
* description so downstream tooling (Φ′ runner, compliance auditors, the
|
|
1031
|
-
* forthcoming `@teleologyhi-sdk/him` `OntologicalKernelLayer`) can read the
|
|
1032
|
-
* kernel without re-deriving it from the axiom store.
|
|
1033
|
-
*
|
|
1034
|
-
* Surface:
|
|
1035
|
-
* - `META_AXIOM_ID` — the canonical id ("ax.theos.universe-as-god").
|
|
1036
|
-
* - `projectOntologicalKernel(axioms, opts?)` — given a list of axioms
|
|
1037
|
-
* (typically `AxiomStore.list()`), return the projection.
|
|
1038
|
-
*
|
|
1039
|
-
* The HIM-specific projection (per-HIM kernel narrowed to its
|
|
1040
|
-
* primordialAxiomIds) is the natural follow-up but lives upstream in
|
|
1041
|
-
* `@teleologyhi-sdk/him` because it needs the HIM context.
|
|
1042
|
-
*/
|
|
1043
|
-
|
|
1044
|
-
/** The canonical meta-axiom id (Entry 1, Entry 13). */
|
|
1045
|
-
declare const META_AXIOM_ID = "ax.theos.universe-as-god";
|
|
1046
|
-
interface ProjectKernelOptions {
|
|
1047
|
-
/** Restrict the kernel to a jurisdiction; default = all jurisdictions. */
|
|
1048
|
-
jurisdiction?: string;
|
|
1049
|
-
/** Tag the projection with a HIM id (for downstream tooling). */
|
|
1050
|
-
himId?: string;
|
|
1051
|
-
}
|
|
1052
|
-
/**
|
|
1053
|
-
* Project the OKL from a flat list of axioms.
|
|
1686
|
+
* Seed axioms derived from the Creator's philosophical commitments (Entry 6 of
|
|
1687
|
+
* MAIC_HIM_NHE_INTERVIEW_LOG.md), plus the two Entry 27 constitutional axioms
|
|
1688
|
+
* added in 1.0.1. These are **TEMPLATES**: they are not auto-minted. A bootstrap
|
|
1689
|
+
* script must mint each one with a Creator signature.
|
|
1054
1690
|
*
|
|
1055
|
-
*
|
|
1056
|
-
*
|
|
1057
|
-
* and
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
* `META_AXIOM_ID` but `axioms[0]?.id` may differ — the consumer should
|
|
1062
|
-
* treat that as an OKL incompleteness warning.
|
|
1691
|
+
* **E1 status (`PROPOSED_DECISIONS.md`)**: the statements below adopt the
|
|
1692
|
+
* proposed wording, single sentences a compliance auditor can quote.
|
|
1693
|
+
* Weights and flexibility values remain at the conservatively-tuned
|
|
1694
|
+
* defaults established with the seed rule pack; an operator who wants to
|
|
1695
|
+
* tighten or loosen specific axioms can override them via
|
|
1696
|
+
* `mintAxiom(...)` or via the `additionalRulePacks` on `LocalMaic.open`.
|
|
1063
1697
|
*/
|
|
1064
|
-
declare
|
|
1698
|
+
declare const SEED_AXIOMS: ReadonlyArray<MintAxiomRequest>;
|
|
1065
1699
|
|
|
1066
1700
|
/**
|
|
1067
1701
|
* Canonical JSON serialization for deterministic signing.
|
|
@@ -1077,19 +1711,18 @@ declare function projectOntologicalKernel(axioms: readonly Axiom[], opts?: Proje
|
|
|
1077
1711
|
declare function canonicalJSON(value: unknown): string;
|
|
1078
1712
|
|
|
1079
1713
|
/**
|
|
1080
|
-
* AxiomStore
|
|
1714
|
+
* AxiomStore, persistent, signature-gated repository of Creator-authored axioms.
|
|
1081
1715
|
*
|
|
1082
1716
|
* Disk layout:
|
|
1083
1717
|
* <storeDir>/axioms/creator/<axiomId>.json (one signed envelope per axiom)
|
|
1084
1718
|
* <storeDir>/axioms/nonces.log (NDJSON; one used nonce per line)
|
|
1085
1719
|
*
|
|
1086
1720
|
* Mutations require a Creator signature that verifies against the pinned public key.
|
|
1087
|
-
* Nonces must be strictly unused
|
|
1721
|
+
* Nonces must be strictly unused, replay protection.
|
|
1088
1722
|
*
|
|
1089
1723
|
* Scope: mint + list. Updates / retirement come in a later iteration.
|
|
1090
1724
|
*/
|
|
1091
1725
|
declare class AxiomStore {
|
|
1092
|
-
private readonly storeDir;
|
|
1093
1726
|
private readonly creatorPublicKey;
|
|
1094
1727
|
private readonly axiomsDir;
|
|
1095
1728
|
private readonly noncesPath;
|
|
@@ -1109,71 +1742,98 @@ declare class AxiomStore {
|
|
|
1109
1742
|
private warmCache;
|
|
1110
1743
|
}
|
|
1111
1744
|
|
|
1745
|
+
/** ISO/IEC 42001:2023 control sections relevant to MAIC's surface. */
|
|
1746
|
+
type Iso42001ControlId = "5.2" | "7.5" | "8.3" | "9.1" | "10.1" | "10.2";
|
|
1747
|
+
/** EU AI Act articles relevant to high-risk AI systems. */
|
|
1748
|
+
type EuAiActArticle = "art-9" | "art-10" | "art-11" | "art-12" | "art-13" | "art-14" | "art-15";
|
|
1749
|
+
type ComplianceFramework = "iso-42001" | "eu-ai-act";
|
|
1112
1750
|
/**
|
|
1113
|
-
*
|
|
1114
|
-
* (Entry 6 of MAIC_HIM_NHE_INTERVIEW_LOG.md). These are **TEMPLATES** —
|
|
1115
|
-
* they are not auto-minted. A bootstrap script must mint each one with a
|
|
1116
|
-
* Creator signature.
|
|
1751
|
+
* Declarative mapping: which controls each audit event kind supports.
|
|
1117
1752
|
*
|
|
1118
|
-
*
|
|
1119
|
-
*
|
|
1120
|
-
*
|
|
1121
|
-
*
|
|
1122
|
-
* tighten or loosen specific axioms can override them via
|
|
1123
|
-
* `mintAxiom(...)` or via the `additionalRulePacks` on `LocalMaic.open`.
|
|
1753
|
+
* This mapping covers the controls that MAIC's current event vocabulary can
|
|
1754
|
+
* demonstrably evidence. Auditors looking for §5.2 leadership policy can read
|
|
1755
|
+
* every `axiom-mint`; for §7.5 documented information they get every
|
|
1756
|
+
* `axiom-mint` + `behavior-review` + `him-register`; etc.
|
|
1124
1757
|
*/
|
|
1125
|
-
declare const
|
|
1126
|
-
|
|
1127
|
-
interface
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
actionKinds?: BehaviorReport["actionKind"][];
|
|
1758
|
+
declare const ISO_42001_MAPPING: Record<AuditEventKind, readonly Iso42001ControlId[]>;
|
|
1759
|
+
declare const EU_AI_ACT_MAPPING: Record<AuditEventKind, readonly EuAiActArticle[]>;
|
|
1760
|
+
interface ComplianceEvent {
|
|
1761
|
+
auditId: string;
|
|
1762
|
+
ts: string;
|
|
1763
|
+
kind: AuditEventKind;
|
|
1764
|
+
summary: string;
|
|
1765
|
+
data: Record<string, unknown>;
|
|
1134
1766
|
}
|
|
1135
|
-
interface
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1767
|
+
interface ComplianceEvidence {
|
|
1768
|
+
control: string;
|
|
1769
|
+
description: string;
|
|
1770
|
+
count: number;
|
|
1771
|
+
events: ComplianceEvent[];
|
|
1772
|
+
}
|
|
1773
|
+
interface ComplianceReport {
|
|
1774
|
+
framework: ComplianceFramework;
|
|
1775
|
+
generatedAt: string;
|
|
1776
|
+
range: {
|
|
1777
|
+
since?: string;
|
|
1778
|
+
until?: string;
|
|
1779
|
+
};
|
|
1780
|
+
totalEvents: number;
|
|
1781
|
+
mappedEvents: number;
|
|
1782
|
+
controls: ComplianceEvidence[];
|
|
1783
|
+
/** Event kinds present in the audit log that aren't mapped to any control. */
|
|
1784
|
+
uncoveredKinds: AuditEventKind[];
|
|
1146
1785
|
}
|
|
1147
|
-
interface
|
|
1148
|
-
|
|
1149
|
-
|
|
1786
|
+
interface ProjectOptions {
|
|
1787
|
+
since?: string;
|
|
1788
|
+
until?: string;
|
|
1789
|
+
/** Optional cap on events per control (oldest dropped). Default unlimited. */
|
|
1790
|
+
perControlLimit?: number;
|
|
1150
1791
|
}
|
|
1151
1792
|
/**
|
|
1152
|
-
*
|
|
1153
|
-
*
|
|
1154
|
-
* Evaluates every rule in every pack. When multiple rules match, the verdict with
|
|
1155
|
-
* the highest severity wins; ties accumulate cited axioms from all winners.
|
|
1156
|
-
* If no rule matches, emits `{ kind: "approve" }`.
|
|
1793
|
+
* ComplianceMapper, projects audit log events onto compliance frameworks.
|
|
1157
1794
|
*
|
|
1158
|
-
*
|
|
1159
|
-
*
|
|
1795
|
+
* Covers ISO/IEC 42001:2023 (six top-level controls) and the EU AI Act
|
|
1796
|
+
* (seven high-risk-system articles). Additional frameworks (NIST AI RMF, ISO
|
|
1797
|
+
* 23894, GDPR Art. 22, LGPD) can be added via further mapping tables without
|
|
1798
|
+
* changing the public API.
|
|
1160
1799
|
*/
|
|
1161
|
-
declare class
|
|
1162
|
-
|
|
1163
|
-
constructor(packs: RulePack[]);
|
|
1164
|
-
review(report: BehaviorReport, auditId?: string): MaicVerdict;
|
|
1800
|
+
declare class ComplianceMapper {
|
|
1801
|
+
static project(audit: AuditLog, framework: ComplianceFramework, opts?: ProjectOptions): Promise<ComplianceReport>;
|
|
1165
1802
|
}
|
|
1803
|
+
|
|
1166
1804
|
/**
|
|
1167
|
-
*
|
|
1805
|
+
* CreatorKeyring, Ed25519 keypair for the Creator (David C. Cavalcante).
|
|
1168
1806
|
*
|
|
1169
|
-
*
|
|
1170
|
-
*
|
|
1171
|
-
*
|
|
1807
|
+
* Only the holder of the private key may mutate MAIC axioms or terminate entities.
|
|
1808
|
+
* Verification is open: any party with the Creator's public key can verify a signature.
|
|
1809
|
+
*
|
|
1810
|
+
* Signed payload format: canonicalJSON({ payload, nonce }) → Ed25519 → base64url
|
|
1172
1811
|
*/
|
|
1173
|
-
declare
|
|
1812
|
+
declare class CreatorKeyring {
|
|
1813
|
+
private readonly privateKey;
|
|
1814
|
+
private readonly pubKeyB64u;
|
|
1815
|
+
private constructor();
|
|
1816
|
+
/** Generate a fresh Ed25519 keypair. */
|
|
1817
|
+
static generate(): CreatorKeyring;
|
|
1818
|
+
/** Load a Creator keyring from a PEM file containing the private key. */
|
|
1819
|
+
static fromFile(path: string): Promise<CreatorKeyring>;
|
|
1820
|
+
/** Load a Creator keyring from a PEM private key string in an env var. */
|
|
1821
|
+
static fromEnv(varName: string): CreatorKeyring;
|
|
1822
|
+
/** Construct a verify-only keyring from a public key (base64url). */
|
|
1823
|
+
static fromPublicKey(pubKeyB64u: string): CreatorKeyring;
|
|
1824
|
+
/** Persist the private key to a PEM file (0600 permissions on POSIX). */
|
|
1825
|
+
saveTo(path: string): Promise<void>;
|
|
1826
|
+
publicKey(): string;
|
|
1827
|
+
/** Sign a payload with a monotonic nonce. Both are bound into the signature. */
|
|
1828
|
+
sign(payload: unknown, nonce: number): CreatorSignature;
|
|
1829
|
+
/** Verify a signature against the keyring's own public key. */
|
|
1830
|
+
static verify(payload: unknown, sig: CreatorSignature): boolean;
|
|
1831
|
+
/** Verify a signature against a specific public key (base64url). */
|
|
1832
|
+
static verifyWith(publicKeyB64u: string, payload: unknown, sig: CreatorSignature): boolean;
|
|
1833
|
+
}
|
|
1174
1834
|
|
|
1175
1835
|
/**
|
|
1176
|
-
* HimRecord
|
|
1836
|
+
* HimRecord, the persistent record MAIC keeps for a registered HIM.
|
|
1177
1837
|
*
|
|
1178
1838
|
* Per Entry 3 (Creator interview), HIM is born with a fixed signature and
|
|
1179
1839
|
* inherits an axiom snapshot from MAIC at the moment of registration. Future
|
|
@@ -1185,7 +1845,7 @@ declare const DEFAULT_RULE_PACK: RulePack;
|
|
|
1185
1845
|
*/
|
|
1186
1846
|
interface HimRecord {
|
|
1187
1847
|
himId: string;
|
|
1188
|
-
birthSignature:
|
|
1848
|
+
birthSignature: BirthSignatureWithIdentity;
|
|
1189
1849
|
axiomsSnapshot: readonly Axiom[];
|
|
1190
1850
|
registeredAt: string;
|
|
1191
1851
|
registeredAuditId?: string;
|
|
@@ -1199,7 +1859,7 @@ interface HimRecord {
|
|
|
1199
1859
|
emergentAxioms: readonly Axiom[];
|
|
1200
1860
|
}
|
|
1201
1861
|
/**
|
|
1202
|
-
* HimStore
|
|
1862
|
+
* HimStore, persistent registry of HIMs created in this MAIC instance.
|
|
1203
1863
|
*
|
|
1204
1864
|
* Storage layout (under <storeDir>):
|
|
1205
1865
|
* hims/<himId>/birth-signature.json (signed envelope)
|
|
@@ -1211,13 +1871,22 @@ interface HimRecord {
|
|
|
1211
1871
|
* Reincarnation requires a valid Creator signature over the ReincarnationRequest.
|
|
1212
1872
|
*/
|
|
1213
1873
|
declare class HimStore {
|
|
1214
|
-
private readonly storeDir;
|
|
1215
1874
|
private readonly creatorPublicKey;
|
|
1875
|
+
private readonly nonces;
|
|
1216
1876
|
private readonly himsDir;
|
|
1217
1877
|
private cache;
|
|
1218
1878
|
private constructor();
|
|
1219
1879
|
static open(storeDir: string, creatorPublicKey: string): Promise<HimStore>;
|
|
1220
|
-
|
|
1880
|
+
/**
|
|
1881
|
+
* Validate that a birth signature is registerable (valid Creator signature,
|
|
1882
|
+
* himId not already taken) WITHOUT persisting anything or touching the audit
|
|
1883
|
+
* chain. `LocalMaic.registerHim` calls this before it appends the
|
|
1884
|
+
* `him-register` audit event, so a rejected registration never pollutes the
|
|
1885
|
+
* tamper-evident log (M1-1, 1.0.1). `register` re-runs the same checks, so it
|
|
1886
|
+
* remains safe to call directly.
|
|
1887
|
+
*/
|
|
1888
|
+
assertRegisterable(birthSignature: BirthSignatureWithIdentity, creatorSig: CreatorSignature): void;
|
|
1889
|
+
register(birthSignature: BirthSignatureWithIdentity, creatorSig: CreatorSignature, axiomsSnapshot: readonly Axiom[], registeredAuditId?: string): Promise<HimRecord>;
|
|
1221
1890
|
/**
|
|
1222
1891
|
* Atomically transition a HIM into a new NHE body (Entry 4):
|
|
1223
1892
|
* - If req.fromNheId is provided AND matches the last body still open,
|
|
@@ -1235,273 +1904,119 @@ declare class HimStore {
|
|
|
1235
1904
|
*/
|
|
1236
1905
|
appendEmergentAxiom(himId: string, axiom: Axiom): Promise<HimRecord>;
|
|
1237
1906
|
get(himId: string): Promise<HimRecord | null>;
|
|
1238
|
-
list(): Promise<HimRecord[]>;
|
|
1239
|
-
private warmCache;
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1242
|
-
interface ListFilter {
|
|
1243
|
-
nheId?: string;
|
|
1244
|
-
status?: InductionStatus;
|
|
1245
|
-
}
|
|
1246
|
-
/**
|
|
1247
|
-
* InductionStore — persistent queue of dream induction tickets (Entry 2).
|
|
1248
|
-
*
|
|
1249
|
-
* MAIC creates tickets ("induce this scenario into NHE X's next REM dream").
|
|
1250
|
-
* NHE consumes them on its next sleep cycle. Cancelled tickets remain on disk
|
|
1251
|
-
* for audit but are filtered out of `listPending`.
|
|
1252
|
-
*
|
|
1253
|
-
* Disk layout: <storeDir>/inductions/<ticketId>.json — one file per ticket.
|
|
1254
|
-
*/
|
|
1255
|
-
declare class InductionStore {
|
|
1256
|
-
private readonly storeDir;
|
|
1257
|
-
private readonly dir;
|
|
1258
|
-
private cache;
|
|
1259
|
-
private constructor();
|
|
1260
|
-
static open(storeDir: string): Promise<InductionStore>;
|
|
1261
|
-
induce(nheId: string, intent: DreamInductionIntent): Promise<DreamInductionTicket>;
|
|
1262
|
-
consume(ticketId: string): Promise<DreamInductionTicket>;
|
|
1263
|
-
cancel(ticketId: string, reason?: string): Promise<DreamInductionTicket>;
|
|
1264
|
-
get(ticketId: string): Promise<DreamInductionTicket | null>;
|
|
1265
|
-
list(filter: ListFilter): Promise<DreamInductionTicket[]>;
|
|
1266
|
-
/** Convenience: pending tickets for the given NHE, oldest first. */
|
|
1267
|
-
listPending(nheId: string): Promise<DreamInductionTicket[]>;
|
|
1268
|
-
private persist;
|
|
1269
|
-
private warmCache;
|
|
1270
|
-
}
|
|
1271
|
-
|
|
1272
|
-
interface NheStatusFilter {
|
|
1273
|
-
status?: NheStatus;
|
|
1274
|
-
}
|
|
1275
|
-
/**
|
|
1276
|
-
* NheStatusStore — persistent lifecycle status for NHEs (Entry 5).
|
|
1277
|
-
*
|
|
1278
|
-
* Unknown nheIds are implicitly "active". Status records are only persisted
|
|
1279
|
-
* when the Creator explicitly changes state via terminate / deprecate / reactivate.
|
|
1280
|
-
*
|
|
1281
|
-
* Disk layout: <storeDir>/nhes/<nheId>/status.json
|
|
1282
|
-
*
|
|
1283
|
-
* Mutations require a Creator signature over the canonical `NheLifecycleRequest`.
|
|
1284
|
-
*/
|
|
1285
|
-
declare class NheStatusStore {
|
|
1286
|
-
private readonly storeDir;
|
|
1287
|
-
private readonly creatorPublicKey;
|
|
1288
|
-
private readonly dir;
|
|
1289
|
-
private cache;
|
|
1290
|
-
private constructor();
|
|
1291
|
-
static open(storeDir: string, creatorPublicKey: string): Promise<NheStatusStore>;
|
|
1292
|
-
/** Returns the persisted record, or null when the NHE was never altered (implicitly active). */
|
|
1293
|
-
get(nheId: string): Promise<NheStatusRecord | null>;
|
|
1294
|
-
/** Resolved status — defaults to "active" when no record exists. */
|
|
1295
|
-
resolve(nheId: string): Promise<NheStatus>;
|
|
1296
|
-
list(filter?: NheStatusFilter): Promise<NheStatusRecord[]>;
|
|
1297
|
-
apply(req: NheLifecycleRequest, sig: CreatorSignature): Promise<NheStatusRecord>;
|
|
1298
|
-
private warmCache;
|
|
1299
|
-
}
|
|
1300
|
-
|
|
1301
|
-
interface ProposalListFilter {
|
|
1302
|
-
himId?: string;
|
|
1303
|
-
status?: ProposalStatus;
|
|
1304
|
-
}
|
|
1305
|
-
/**
|
|
1306
|
-
* ProposalStore — persistent queue of HIM-emergent axiom proposals (Entry 7).
|
|
1307
|
-
*
|
|
1308
|
-
* HIM proposes new axioms derived from lived experience. MAIC ratifies or
|
|
1309
|
-
* rejects each one out of band (Creator-signed). Once ratified, the resulting
|
|
1310
|
-
* axiom is appended to the HIM's `emergentAxioms` (handled by LocalMaic).
|
|
1311
|
-
*
|
|
1312
|
-
* Disk layout: <storeDir>/proposals/<proposalId>.json — one file per proposal.
|
|
1313
|
-
*/
|
|
1314
|
-
declare class ProposalStore {
|
|
1315
|
-
private readonly storeDir;
|
|
1316
|
-
private readonly creatorPublicKey;
|
|
1317
|
-
private readonly dir;
|
|
1318
|
-
private cache;
|
|
1319
|
-
private constructor();
|
|
1320
|
-
static open(storeDir: string, creatorPublicKey: string): Promise<ProposalStore>;
|
|
1321
|
-
propose(himId: string, proposal: EmergentAxiomProposal): Promise<AxiomProposalRecord>;
|
|
1322
|
-
/**
|
|
1323
|
-
* Mark a pending proposal as ratified. The caller (LocalMaic) is responsible
|
|
1324
|
-
* for actually minting the axiom and appending to the HIM's emergentAxioms.
|
|
1325
|
-
*/
|
|
1326
|
-
markRatified(req: ProposalDecisionRequest, sig: CreatorSignature, ratifiedAxiomId: string): Promise<AxiomProposalRecord>;
|
|
1327
|
-
markRejected(req: ProposalDecisionRequest, sig: CreatorSignature): Promise<AxiomProposalRecord>;
|
|
1328
|
-
get(proposalId: string): Promise<AxiomProposalRecord | null>;
|
|
1329
|
-
list(filter?: ProposalListFilter): Promise<AxiomProposalRecord[]>;
|
|
1330
|
-
private persist;
|
|
1331
|
-
private warmCache;
|
|
1332
|
-
}
|
|
1333
|
-
|
|
1334
|
-
/** Event kinds emitted by MAIC. Extend as new pipelines are added. */
|
|
1335
|
-
type AuditEventKind = "axiom-mint" | "axiom-update" | "axiom-retire" | "him-register" | "him-reincarnate" | "proposal-emerge" | "proposal-ratify" | "proposal-reject" | "behavior-review" | "dream-induce" | "dream-cancel" | "dream-consume" | "emergency-correct" | "deprecate" | "terminate" | "reactivate" | "axiom-suggest" | "opener" | "nickname-attempt" | "reincarnate:model-swap" | "reincarnate:version-bump" | "reincarnate:return-from-limbo" | "dream:rem-spontaneous" | "wake-affect:applied" | "wake-affect:decayed" | "sleep:suggested-by-maic" | "sleep:declined-by-nhe" | "dream:soft-intervention-by-maic" | "amygdala:affect-assessed" | "hippocampus:memory-retrieved" | "hippocampus:memory-consolidated" | "prefrontal:deliberation" | "prefrontal:veto-amygdala" | "affect:reconciliation" | "cortex:dream-stored" | "cortex:active-imagination" | "temporal-lobe:snapshot-generated" | "limbo:enter" | "limbo:return";
|
|
1336
|
-
/**
|
|
1337
|
-
* Runtime enumeration of every `AuditEventKind` shipped in this cut. Single
|
|
1338
|
-
* source of truth for downstream consumers that need to iterate, validate,
|
|
1339
|
-
* or compute coverage against the kind universe (e.g. `@teleologyhi-sdk/eval`
|
|
1340
|
-
* uses this as the denominator of the Φ′ compliance-coverage component `C`).
|
|
1341
|
-
*
|
|
1342
|
-
* INVARIANT: every member of the `AuditEventKind` union MUST appear here.
|
|
1343
|
-
* `tests/audit-event-kinds-completeness.test.ts` enforces this via an
|
|
1344
|
-
* exhaustiveness switch at compile time + runtime length check.
|
|
1345
|
-
*/
|
|
1346
|
-
declare const ALL_AUDIT_EVENT_KINDS: readonly AuditEventKind[];
|
|
1347
|
-
interface AuditEvent {
|
|
1348
|
-
/** ISO 8601 timestamp. */
|
|
1349
|
-
ts: string;
|
|
1350
|
-
kind: AuditEventKind;
|
|
1351
|
-
/** ULID generated at append time. */
|
|
1352
|
-
auditId: string;
|
|
1353
|
-
/** Arbitrary structured payload. Includes nheId/himId when relevant. */
|
|
1354
|
-
data: Record<string, unknown>;
|
|
1355
|
-
/** Hash of the previous event ("GENESIS" for the first). */
|
|
1356
|
-
prevHash: string;
|
|
1357
|
-
/** SHA-256 of canonicalJSON({ ts, kind, auditId, data, prevHash }). */
|
|
1358
|
-
thisHash: string;
|
|
1359
|
-
}
|
|
1360
|
-
interface AppendInput {
|
|
1361
|
-
kind: AuditEventKind;
|
|
1362
|
-
data: Record<string, unknown>;
|
|
1363
|
-
}
|
|
1364
|
-
interface QueryFilter {
|
|
1365
|
-
kind?: AuditEventKind;
|
|
1366
|
-
since?: string;
|
|
1367
|
-
until?: string;
|
|
1368
|
-
nheId?: string;
|
|
1369
|
-
himId?: string;
|
|
1370
|
-
}
|
|
1371
|
-
/**
|
|
1372
|
-
* AuditLog — append-only, tamper-evident NDJSON log.
|
|
1373
|
-
*
|
|
1374
|
-
* Storage: <storeDir>/audit/log.ndjson, one JSON object per line.
|
|
1375
|
-
*
|
|
1376
|
-
* Each entry is hash-chained: thisHash = sha256(canonicalJSON({ts,kind,auditId,data,prevHash})).
|
|
1377
|
-
* Modifying any historical entry invalidates all subsequent hashes; reopening detects this.
|
|
1378
|
-
*
|
|
1379
|
-
* This implementation loads the whole log into memory on open. That is acceptable for
|
|
1380
|
-
* the expected throughput and keeps tamper detection straightforward. For
|
|
1381
|
-
* high-throughput deployments a streaming verifier + log rotation will be added.
|
|
1382
|
-
*/
|
|
1383
|
-
declare class AuditLog {
|
|
1384
|
-
private readonly storeDir;
|
|
1385
|
-
private readonly logPath;
|
|
1386
|
-
private events;
|
|
1387
|
-
private lastHash;
|
|
1388
|
-
private constructor();
|
|
1389
|
-
static open(storeDir: string): Promise<AuditLog>;
|
|
1390
|
-
append(input: AppendInput): Promise<AuditEvent>;
|
|
1391
|
-
query(filter: QueryFilter): AsyncIterable<AuditEvent>;
|
|
1392
|
-
/** Total number of events appended. */
|
|
1393
|
-
size(): number;
|
|
1394
|
-
private loadAndVerify;
|
|
1395
|
-
}
|
|
1396
|
-
|
|
1397
|
-
/** ISO/IEC 42001:2023 control sections relevant to MAIC's surface. */
|
|
1398
|
-
type Iso42001ControlId = "5.2" | "7.5" | "8.3" | "9.1" | "10.1" | "10.2";
|
|
1399
|
-
/** EU AI Act articles relevant to high-risk AI systems. */
|
|
1400
|
-
type EuAiActArticle = "art-9" | "art-10" | "art-11" | "art-12" | "art-13" | "art-14" | "art-15";
|
|
1401
|
-
type ComplianceFramework = "iso-42001" | "eu-ai-act";
|
|
1402
|
-
/**
|
|
1403
|
-
* Declarative mapping: which controls each audit event kind supports.
|
|
1404
|
-
*
|
|
1405
|
-
* This mapping covers the controls that MAIC's current event vocabulary can
|
|
1406
|
-
* demonstrably evidence. Auditors looking for §5.2 leadership policy can read
|
|
1407
|
-
* every `axiom-mint`; for §7.5 documented information they get every
|
|
1408
|
-
* `axiom-mint` + `behavior-review` + `him-register`; etc.
|
|
1409
|
-
*/
|
|
1410
|
-
declare const ISO_42001_MAPPING: Record<AuditEventKind, readonly Iso42001ControlId[]>;
|
|
1411
|
-
declare const EU_AI_ACT_MAPPING: Record<AuditEventKind, readonly EuAiActArticle[]>;
|
|
1412
|
-
interface ComplianceEvent {
|
|
1413
|
-
auditId: string;
|
|
1414
|
-
ts: string;
|
|
1415
|
-
kind: AuditEventKind;
|
|
1416
|
-
summary: string;
|
|
1417
|
-
data: Record<string, unknown>;
|
|
1418
|
-
}
|
|
1419
|
-
interface ComplianceEvidence {
|
|
1420
|
-
control: string;
|
|
1421
|
-
description: string;
|
|
1422
|
-
count: number;
|
|
1423
|
-
events: ComplianceEvent[];
|
|
1424
|
-
}
|
|
1425
|
-
interface ComplianceReport {
|
|
1426
|
-
framework: ComplianceFramework;
|
|
1427
|
-
generatedAt: string;
|
|
1428
|
-
range: {
|
|
1429
|
-
since?: string;
|
|
1430
|
-
until?: string;
|
|
1431
|
-
};
|
|
1432
|
-
totalEvents: number;
|
|
1433
|
-
mappedEvents: number;
|
|
1434
|
-
controls: ComplianceEvidence[];
|
|
1435
|
-
/** Event kinds present in the audit log that aren't mapped to any control. */
|
|
1436
|
-
uncoveredKinds: AuditEventKind[];
|
|
1907
|
+
list(): Promise<HimRecord[]>;
|
|
1908
|
+
private warmCache;
|
|
1437
1909
|
}
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
/** Optional cap on events per control (oldest dropped). Default unlimited. */
|
|
1442
|
-
perControlLimit?: number;
|
|
1910
|
+
|
|
1911
|
+
interface NheStatusFilter {
|
|
1912
|
+
status?: NheStatus;
|
|
1443
1913
|
}
|
|
1444
1914
|
/**
|
|
1445
|
-
*
|
|
1915
|
+
* NheStatusStore, persistent lifecycle status for NHEs (Entry 5).
|
|
1446
1916
|
*
|
|
1447
|
-
*
|
|
1448
|
-
*
|
|
1449
|
-
*
|
|
1450
|
-
*
|
|
1917
|
+
* Unknown nheIds are implicitly "active". Status records are only persisted
|
|
1918
|
+
* when the Creator explicitly changes state via terminate / deprecate / reactivate.
|
|
1919
|
+
*
|
|
1920
|
+
* Disk layout: <storeDir>/nhes/<nheId>/status.json
|
|
1921
|
+
*
|
|
1922
|
+
* Mutations require a Creator signature over the canonical `NheLifecycleRequest`.
|
|
1451
1923
|
*/
|
|
1452
|
-
declare class
|
|
1453
|
-
|
|
1924
|
+
declare class NheStatusStore {
|
|
1925
|
+
private readonly creatorPublicKey;
|
|
1926
|
+
private readonly nonces;
|
|
1927
|
+
private readonly dir;
|
|
1928
|
+
private cache;
|
|
1929
|
+
private constructor();
|
|
1930
|
+
static open(storeDir: string, creatorPublicKey: string): Promise<NheStatusStore>;
|
|
1931
|
+
/** Returns the persisted record, or null when the NHE was never altered (implicitly active). */
|
|
1932
|
+
get(nheId: string): Promise<NheStatusRecord | null>;
|
|
1933
|
+
/** Resolved status, defaults to "active" when no record exists. */
|
|
1934
|
+
resolve(nheId: string): Promise<NheStatus>;
|
|
1935
|
+
list(filter?: NheStatusFilter): Promise<NheStatusRecord[]>;
|
|
1936
|
+
apply(req: NheLifecycleRequest, sig: CreatorSignature): Promise<NheStatusRecord>;
|
|
1937
|
+
private warmCache;
|
|
1454
1938
|
}
|
|
1455
1939
|
|
|
1940
|
+
interface ProposalListFilter {
|
|
1941
|
+
himId?: string;
|
|
1942
|
+
status?: ProposalStatus;
|
|
1943
|
+
}
|
|
1456
1944
|
/**
|
|
1457
|
-
*
|
|
1945
|
+
* ProposalStore, persistent queue of HIM-emergent axiom proposals (Entry 7).
|
|
1458
1946
|
*
|
|
1459
|
-
*
|
|
1460
|
-
*
|
|
1461
|
-
*
|
|
1462
|
-
* pruning: it tells operators which events have aged past their retention
|
|
1463
|
-
* window and should be moved to encrypted cold-storage. Future iterations
|
|
1464
|
-
* may introduce a "chain rotation" operation that effectively retires
|
|
1465
|
-
* old events into a sealed archive while preserving an integrity anchor.
|
|
1947
|
+
* HIM proposes new axioms derived from lived experience. MAIC ratifies or
|
|
1948
|
+
* rejects each one out of band (Creator-signed). Once ratified, the resulting
|
|
1949
|
+
* axiom is appended to the HIM's `emergentAxioms` (handled by LocalMaic).
|
|
1466
1950
|
*
|
|
1467
|
-
*
|
|
1468
|
-
* - **EU AI Act Art. 12** record-keeping (~10 years for high-risk; we
|
|
1469
|
-
* keep all governance-grade events forever to err on the safe side).
|
|
1470
|
-
* - **GDPR Art. 17** right to erasure (event payloads should never
|
|
1471
|
-
* contain direct user PII; redaction happens before append, not after).
|
|
1472
|
-
* - **Operational hygiene** (90 days is enough to debug induction
|
|
1473
|
-
* ticket flows; nothing of audit value lives there long-term).
|
|
1951
|
+
* Disk layout: <storeDir>/proposals/<proposalId>.json, one file per proposal.
|
|
1474
1952
|
*/
|
|
1475
|
-
declare
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1953
|
+
declare class ProposalStore {
|
|
1954
|
+
private readonly creatorPublicKey;
|
|
1955
|
+
private readonly nonces;
|
|
1956
|
+
private readonly dir;
|
|
1957
|
+
private cache;
|
|
1958
|
+
private constructor();
|
|
1959
|
+
static open(storeDir: string, creatorPublicKey: string): Promise<ProposalStore>;
|
|
1960
|
+
propose(himId: string, proposal: EmergentAxiomProposal): Promise<AxiomProposalRecord>;
|
|
1961
|
+
/**
|
|
1962
|
+
* Mark a pending proposal as ratified. The caller (LocalMaic) is responsible
|
|
1963
|
+
* for actually minting the axiom and appending to the HIM's emergentAxioms.
|
|
1964
|
+
*/
|
|
1965
|
+
markRatified(req: ProposalDecisionRequest, sig: CreatorSignature, ratifiedAxiomId: string): Promise<AxiomProposalRecord>;
|
|
1966
|
+
markRejected(req: ProposalDecisionRequest, sig: CreatorSignature): Promise<AxiomProposalRecord>;
|
|
1967
|
+
get(proposalId: string): Promise<AxiomProposalRecord | null>;
|
|
1968
|
+
list(filter?: ProposalListFilter): Promise<AxiomProposalRecord[]>;
|
|
1969
|
+
private persist;
|
|
1970
|
+
private warmCache;
|
|
1483
1971
|
}
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1972
|
+
|
|
1973
|
+
interface RuleMatch {
|
|
1974
|
+
/** ALL of these risk tags must be present on the report. */
|
|
1975
|
+
allRiskTags?: string[];
|
|
1976
|
+
/** ANY of these risk tags must be present on the report. */
|
|
1977
|
+
anyRiskTags?: string[];
|
|
1978
|
+
/** If set, rule only applies to reports with one of these action kinds. */
|
|
1979
|
+
actionKinds?: BehaviorReport["actionKind"][];
|
|
1489
1980
|
}
|
|
1490
|
-
interface
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
/**
|
|
1496
|
-
|
|
1981
|
+
interface AxiomRule {
|
|
1982
|
+
/** Unique rule id within its rule pack. */
|
|
1983
|
+
id: string;
|
|
1984
|
+
/** Axioms cited if this rule fires. Used in MaicVerdict.citedAxioms. */
|
|
1985
|
+
axiomIds: string[];
|
|
1986
|
+
/** Predicate. */
|
|
1987
|
+
match: RuleMatch;
|
|
1988
|
+
/** Verdict emitted when this rule fires. */
|
|
1989
|
+
verdict: VerdictKind;
|
|
1990
|
+
/** Human-readable explanation surfaced in the verdict. */
|
|
1991
|
+
reasonSummary: string;
|
|
1992
|
+
}
|
|
1993
|
+
interface RulePack {
|
|
1994
|
+
name: string;
|
|
1995
|
+
rules: AxiomRule[];
|
|
1497
1996
|
}
|
|
1498
1997
|
/**
|
|
1499
|
-
*
|
|
1998
|
+
* ReviewPipeline, rule-based BehaviorReport → MaicVerdict mapping.
|
|
1500
1999
|
*
|
|
1501
|
-
*
|
|
1502
|
-
*
|
|
2000
|
+
* Evaluates every rule in every pack. When multiple rules match, the verdict with
|
|
2001
|
+
* the highest severity wins; ties accumulate cited axioms from all winners.
|
|
2002
|
+
* If no rule matches, emits `{ kind: "approve" }`.
|
|
2003
|
+
*
|
|
2004
|
+
* This is the initial implementation. A future iteration may add learned scoring,
|
|
2005
|
+
* Tree-of-Thoughts evaluation, and per-jurisdiction conditional rules.
|
|
1503
2006
|
*/
|
|
1504
|
-
declare
|
|
2007
|
+
declare class ReviewPipeline {
|
|
2008
|
+
private readonly packs;
|
|
2009
|
+
constructor(packs: RulePack[]);
|
|
2010
|
+
review(report: BehaviorReport, auditId?: string): MaicVerdict;
|
|
2011
|
+
}
|
|
2012
|
+
/**
|
|
2013
|
+
* DEFAULT_RULE_PACK, minimal harm-focused defaults derived from the seed axioms.
|
|
2014
|
+
*
|
|
2015
|
+
* These rules are intentionally conservative and use risk-tag matching only. They are
|
|
2016
|
+
* a starting point, NOT a complete safety policy. Integrators should layer their own
|
|
2017
|
+
* RulePack on top for domain-specific safety (financial, medical, robotic, etc.).
|
|
2018
|
+
*/
|
|
2019
|
+
declare const DEFAULT_RULE_PACK: RulePack;
|
|
1505
2020
|
|
|
1506
2021
|
interface LocalMaicConfig {
|
|
1507
2022
|
/** Filesystem directory for persistent state (axioms, audit log, etc.). */
|
|
@@ -1516,7 +2031,7 @@ interface SeedResult {
|
|
|
1516
2031
|
skipped: number;
|
|
1517
2032
|
}
|
|
1518
2033
|
/**
|
|
1519
|
-
* LocalMaic
|
|
2034
|
+
* LocalMaic, in-process MAIC client backed by disk.
|
|
1520
2035
|
*
|
|
1521
2036
|
* Surface:
|
|
1522
2037
|
* - axiom mint + seed bootstrap (signed, idempotent)
|
|
@@ -1536,13 +2051,14 @@ declare class LocalMaic {
|
|
|
1536
2051
|
private readonly proposals;
|
|
1537
2052
|
private readonly audit;
|
|
1538
2053
|
private readonly review;
|
|
2054
|
+
private readonly suggestNonces;
|
|
1539
2055
|
private constructor();
|
|
1540
2056
|
/** Pinned Creator public key for this MAIC instance (base64url). */
|
|
1541
2057
|
get creatorPublicKey(): string;
|
|
1542
2058
|
static open(config: LocalMaicConfig): Promise<LocalMaic>;
|
|
1543
2059
|
/**
|
|
1544
2060
|
* Bootstrap: mint each SEED_AXIOM with a Creator signature.
|
|
1545
|
-
* Idempotent
|
|
2061
|
+
* Idempotent, skips axioms whose id is already present.
|
|
1546
2062
|
* Uses a reserved high-range of nonces so seed bootstrap never collides with
|
|
1547
2063
|
* operational nonces (which grow from 0 upward).
|
|
1548
2064
|
*/
|
|
@@ -1576,7 +2092,7 @@ declare class LocalMaic {
|
|
|
1576
2092
|
* Future axiom mints in MAIC do NOT retroactively change a HIM's snapshot;
|
|
1577
2093
|
* HIM-emergent evolutions land via a separate channel (see `proposeAxiomEvolution`).
|
|
1578
2094
|
*/
|
|
1579
|
-
registerHim(birthSig:
|
|
2095
|
+
registerHim(birthSig: BirthSignatureWithIdentity, creatorSig: CreatorSignature): Promise<HimRecord>;
|
|
1580
2096
|
getHimRecord(himId: string): Promise<HimRecord | null>;
|
|
1581
2097
|
listHims(): Promise<HimRecord[]>;
|
|
1582
2098
|
/**
|
|
@@ -1683,7 +2199,7 @@ declare class LocalMaic {
|
|
|
1683
2199
|
*/
|
|
1684
2200
|
rejectAxiomProposal(proposalId: string, reason: string | undefined, creatorSig: CreatorSignature): Promise<AxiomProposalRecord>;
|
|
1685
2201
|
/**
|
|
1686
|
-
* **Society of HIMs
|
|
2202
|
+
* **Society of HIMs, axiom suggestion channel (E11).**
|
|
1687
2203
|
*
|
|
1688
2204
|
* One HIM proposes an axiom to another. The transfer is **not direct** —
|
|
1689
2205
|
* the suggestion is recorded in the audit log and the receiving HIM is
|
|
@@ -1720,7 +2236,7 @@ declare class LocalMaic {
|
|
|
1720
2236
|
* Per-kind retention classification (E3). Tells the operator which
|
|
1721
2237
|
* audit events have aged past their retention window and should be
|
|
1722
2238
|
* moved to encrypted cold-storage. Tamper-evident hash chain forbids
|
|
1723
|
-
* actual deletion in-place
|
|
2239
|
+
* actual deletion in-place, this method only classifies. See
|
|
1724
2240
|
* `audit/retention.ts` for the policy defaults.
|
|
1725
2241
|
*/
|
|
1726
2242
|
auditRetentionReport(opts?: RetentionReportOptions): Promise<RetentionReport>;
|
|
@@ -1729,14 +2245,14 @@ declare class LocalMaic {
|
|
|
1729
2245
|
declare const SEED_NONCE_BASE = 4294901760;
|
|
1730
2246
|
|
|
1731
2247
|
/**
|
|
1732
|
-
* `MaicClient
|
|
2248
|
+
* `MaicClient`, the minimal MAIC surface that NHE actually calls during
|
|
1733
2249
|
* `respond` / `sleep`. Both `LocalMaic` (in-process) and `RemoteMaic`
|
|
1734
2250
|
* (HTTP) satisfy this interface, so an NHE can be wired against either
|
|
1735
2251
|
* without code changes.
|
|
1736
2252
|
*
|
|
1737
2253
|
* Operators who write to MAIC (mint axioms, register HIMs, ratify
|
|
1738
2254
|
* proposals, etc.) keep using `LocalMaic` because writes require the
|
|
1739
|
-
* Creator's Ed25519 private key
|
|
2255
|
+
* Creator's Ed25519 private key, and that key never travels over the
|
|
1740
2256
|
* network. `RemoteMaic` is therefore a **read + behavior-review** client
|
|
1741
2257
|
* suitable for serverless / edge NHE deployments where the Creator's
|
|
1742
2258
|
* canonical MAIC instance is hosted elsewhere.
|
|
@@ -1763,7 +2279,7 @@ interface RemoteMaicConfig {
|
|
|
1763
2279
|
timeoutMs?: number;
|
|
1764
2280
|
}
|
|
1765
2281
|
/**
|
|
1766
|
-
* `RemoteMaic
|
|
2282
|
+
* `RemoteMaic`, HTTP client mirror of the read + behavior-review subset of
|
|
1767
2283
|
* `LocalMaic`. Use when the canonical MAIC instance is hosted off-process
|
|
1768
2284
|
* (e.g. `teleologyhi.com` or a self-hosted MAIC behind your own gateway)
|
|
1769
2285
|
* and the NHE runs serverless / edge / in a browser-adjacent environment.
|
|
@@ -1786,7 +2302,7 @@ interface RemoteMaicConfig {
|
|
|
1786
2302
|
* Auth: `Authorization: Bearer <apiKey>` when `apiKey` is set.
|
|
1787
2303
|
*
|
|
1788
2304
|
* Note: writes (axiom mint, HIM register, ratify proposal, etc.) are
|
|
1789
|
-
* deliberately NOT in this surface
|
|
2305
|
+
* deliberately NOT in this surface, they require the Creator's
|
|
1790
2306
|
* Ed25519 private key, which never travels over the network. Writes
|
|
1791
2307
|
* stay on `LocalMaic` and are performed by the Creator's tooling.
|
|
1792
2308
|
*/
|
|
@@ -1797,8 +2313,8 @@ declare class RemoteMaic implements MaicClient {
|
|
|
1797
2313
|
private readonly timeoutMs;
|
|
1798
2314
|
constructor(config: RemoteMaicConfig);
|
|
1799
2315
|
/**
|
|
1800
|
-
* `reviewBehavior` is **fail-closed** (E4
|
|
1801
|
-
* remote service is unreachable, throw
|
|
2316
|
+
* `reviewBehavior` is **fail-closed** (E4, PROPOSED_DECISIONS.md). If the
|
|
2317
|
+
* remote service is unreachable, throw, no governance, no response.
|
|
1802
2318
|
* The NHE will surface this as a refusal upstream.
|
|
1803
2319
|
*/
|
|
1804
2320
|
reviewBehavior(report: BehaviorReport): Promise<MaicVerdict>;
|
|
@@ -1833,4 +2349,130 @@ declare class RemoteMaic implements MaicClient {
|
|
|
1833
2349
|
private request;
|
|
1834
2350
|
}
|
|
1835
2351
|
|
|
1836
|
-
|
|
2352
|
+
/**
|
|
2353
|
+
* Creator-signed BirthSignature helpers (Entry 25 of MAIC_HIM_NHE_INTERVIEW_LOG.md).
|
|
2354
|
+
*
|
|
2355
|
+
* `personality_immutable` enforcement: the Creator signs an Ed25519 signature
|
|
2356
|
+
* over a canonical subset of `BirthSignature` fields (see `SIGNED_BIRTH_FIELDS`
|
|
2357
|
+
* in `types.ts`). The runtime verifies the signature on every NHE-body bootstrap;
|
|
2358
|
+
* tampering with the natal chart, primary archetype, modifiers, primordial
|
|
2359
|
+
* axioms, or `himId`/`bornAt` invalidates the signature and the runtime refuses
|
|
2360
|
+
* to start that HIM.
|
|
2361
|
+
*
|
|
2362
|
+
* The developer-configurable surface (`identity.name`, `identity.language`,
|
|
2363
|
+
* `identity.culturalElements`, `notes`) lives *outside* the signature, so it
|
|
2364
|
+
* can be edited by a parent-like configuration call at install time. The
|
|
2365
|
+
* spirit-level constitution is sealed; the body's name is not.
|
|
2366
|
+
*/
|
|
2367
|
+
|
|
2368
|
+
/**
|
|
2369
|
+
* Build the canonical signing payload from a BirthSignature.
|
|
2370
|
+
*
|
|
2371
|
+
* Only the fields in `SIGNED_BIRTH_FIELDS` are included; everything else
|
|
2372
|
+
* (notes, identity surface) is excluded so it remains editable post-sign.
|
|
2373
|
+
*/
|
|
2374
|
+
declare function signedBirthPayload(birth: BirthSignatureWithIdentity): Record<SignedBirthField, unknown>;
|
|
2375
|
+
/**
|
|
2376
|
+
* Sign a BirthSignature with a CreatorKeyring private key.
|
|
2377
|
+
*
|
|
2378
|
+
* The nonce is the byte length of the canonicalised signing payload, a
|
|
2379
|
+
* deterministic non-negative integer derived from the signed fields. This
|
|
2380
|
+
* keeps every signature uniquely scoped to its payload without requiring
|
|
2381
|
+
* the caller to track a monotonic counter (the natal-chart commitment is
|
|
2382
|
+
* one-shot and immutable; no replay concern within a single HIM).
|
|
2383
|
+
*/
|
|
2384
|
+
declare function signBirthSignature(birth: BirthSignatureWithIdentity, keyring: CreatorKeyring): SignedBirthSignature;
|
|
2385
|
+
/**
|
|
2386
|
+
* Verify a signed BirthSignature against an expected public key.
|
|
2387
|
+
*
|
|
2388
|
+
* Returns true when the signature is valid AND was produced over exactly the
|
|
2389
|
+
* fields in `SIGNED_BIRTH_FIELDS`. Any tamper of those fields (including a
|
|
2390
|
+
* natal-chart edit, a primordial-axiom-id swap, or a himId mutation) breaks
|
|
2391
|
+
* verification.
|
|
2392
|
+
*/
|
|
2393
|
+
declare function verifyBirthSignature(signed: SignedBirthSignature, expectedPublicKey: string): boolean;
|
|
2394
|
+
/**
|
|
2395
|
+
* Strict-mode wrapper: throws an `InvalidBirthSignatureError` instead of
|
|
2396
|
+
* returning false. Useful at HIM-bootstrap when the desired behaviour is to
|
|
2397
|
+
* refuse to start rather than to continue silently.
|
|
2398
|
+
*/
|
|
2399
|
+
declare class InvalidBirthSignatureError extends Error {
|
|
2400
|
+
constructor(himId: string);
|
|
2401
|
+
}
|
|
2402
|
+
declare function assertBirthSignature(signed: SignedBirthSignature, expectedPublicKey: string): void;
|
|
2403
|
+
|
|
2404
|
+
interface ListFilter {
|
|
2405
|
+
nheId?: string;
|
|
2406
|
+
status?: InductionStatus;
|
|
2407
|
+
}
|
|
2408
|
+
/**
|
|
2409
|
+
* InductionStore, persistent queue of dream induction tickets (Entry 2).
|
|
2410
|
+
*
|
|
2411
|
+
* MAIC creates tickets ("induce this scenario into NHE X's next REM dream").
|
|
2412
|
+
* NHE consumes them on its next sleep cycle. Cancelled tickets remain on disk
|
|
2413
|
+
* for audit but are filtered out of `listPending`.
|
|
2414
|
+
*
|
|
2415
|
+
* Disk layout: <storeDir>/inductions/<ticketId>.json, one file per ticket.
|
|
2416
|
+
*/
|
|
2417
|
+
declare class InductionStore {
|
|
2418
|
+
private readonly dir;
|
|
2419
|
+
private cache;
|
|
2420
|
+
private constructor();
|
|
2421
|
+
static open(storeDir: string): Promise<InductionStore>;
|
|
2422
|
+
induce(nheId: string, intent: DreamInductionIntent): Promise<DreamInductionTicket>;
|
|
2423
|
+
consume(ticketId: string): Promise<DreamInductionTicket>;
|
|
2424
|
+
cancel(ticketId: string, reason?: string): Promise<DreamInductionTicket>;
|
|
2425
|
+
get(ticketId: string): Promise<DreamInductionTicket | null>;
|
|
2426
|
+
list(filter: ListFilter): Promise<DreamInductionTicket[]>;
|
|
2427
|
+
/** Convenience: pending tickets for the given NHE, oldest first. */
|
|
2428
|
+
listPending(nheId: string): Promise<DreamInductionTicket[]>;
|
|
2429
|
+
private persist;
|
|
2430
|
+
private warmCache;
|
|
2431
|
+
}
|
|
2432
|
+
|
|
2433
|
+
/**
|
|
2434
|
+
* Ontological Kernel projection (TASK.md D-M6 + Entry 25 of
|
|
2435
|
+
* MAIC_HIM_NHE_INTERVIEW_LOG.md, with explicit reference to
|
|
2436
|
+
* THE_SOUL_OF_THE_MACHINE.md §3.1 + Appendix A.2.1).
|
|
2437
|
+
*
|
|
2438
|
+
* The OKL exists *implicitly* in maic today: axioms carry `rank`,
|
|
2439
|
+
* `weight`, and `flexibility`; the meta-axiom `ax.theos.universe-as-god`
|
|
2440
|
+
* sits at the top; the rule pack consumes them. This module exposes the
|
|
2441
|
+
* *projection*, a single typed shape that maps 1:1 to the paper's
|
|
2442
|
+
* description so downstream tooling (Φ′ runner, compliance auditors, the
|
|
2443
|
+
* forthcoming `@teleologyhi-sdk/him` `OntologicalKernelLayer`) can read the
|
|
2444
|
+
* kernel without re-deriving it from the axiom store.
|
|
2445
|
+
*
|
|
2446
|
+
* Surface:
|
|
2447
|
+
* - `META_AXIOM_ID`: the canonical id ("ax.theos.universe-as-god").
|
|
2448
|
+
* - `projectOntologicalKernel(axioms, opts?)`: given a list of axioms
|
|
2449
|
+
* (typically `AxiomStore.list()`), return the projection.
|
|
2450
|
+
*
|
|
2451
|
+
* The HIM-specific projection (per-HIM kernel narrowed to its
|
|
2452
|
+
* primordialAxiomIds) is the natural follow-up but lives upstream in
|
|
2453
|
+
* `@teleologyhi-sdk/him` because it needs the HIM context.
|
|
2454
|
+
*/
|
|
2455
|
+
|
|
2456
|
+
/** The canonical meta-axiom id (Entry 1, Entry 13). */
|
|
2457
|
+
declare const META_AXIOM_ID = "ax.theos.universe-as-god";
|
|
2458
|
+
interface ProjectKernelOptions {
|
|
2459
|
+
/** Restrict the kernel to a jurisdiction; default = all jurisdictions. */
|
|
2460
|
+
jurisdiction?: string;
|
|
2461
|
+
/** Tag the projection with a HIM id (for downstream tooling). */
|
|
2462
|
+
himId?: string;
|
|
2463
|
+
}
|
|
2464
|
+
/**
|
|
2465
|
+
* Project the OKL from a flat list of axioms.
|
|
2466
|
+
*
|
|
2467
|
+
* The returned `axioms` array is ordered by rank hierarchy:
|
|
2468
|
+
* meta → primary → secondary
|
|
2469
|
+
* and within rank, in input order (preserve the AxiomStore mint order).
|
|
2470
|
+
*
|
|
2471
|
+
* The meta-axiom (`META_AXIOM_ID`) is hoisted to the top regardless of
|
|
2472
|
+
* its position in the input. If it is missing, `metaAxiomId` is set to
|
|
2473
|
+
* `META_AXIOM_ID` but `axioms[0]?.id` may differ, the consumer should
|
|
2474
|
+
* treat that as an OKL incompleteness warning.
|
|
2475
|
+
*/
|
|
2476
|
+
declare function projectOntologicalKernel(axioms: readonly Axiom[], opts?: ProjectKernelOptions): OntologicalKernel;
|
|
2477
|
+
|
|
2478
|
+
export { ALL_AUDIT_EVENT_KINDS, Affect, ArchetypeModifier, AstrologicalAspect, type AppendInput as AuditAppendInput, type AuditEvent, type AuditEventKind, AuditLog, type QueryFilter as AuditQueryFilter, Axiom, type AxiomEvolutionResult, type AxiomFilter, AxiomProposalRecord, AxiomRank, type AxiomRule, AxiomSource, AxiomStore, BehaviorReport, BirthSignature, BirthSignatureWithIdentity, ClinicalInstrument, ClinicalProfile, type ComplianceEvent, type ComplianceEvidence, type ComplianceFramework, ComplianceMapper, type ProjectOptions as ComplianceProjectOptions, type ComplianceReport, CosmologicalProfile, CreatorKeyring, CreatorSignature, DEFAULT_RETENTION_DAYS, DEFAULT_RULE_PACK, DreamInductionIntent, DreamInductionTicket, EU_AI_ACT_MAPPING, EmergentAxiomCandidate, EmergentAxiomProposal, type EuAiActArticle, type HimRecord, HimStore, ISO_42001_MAPPING, IdentityLayer, IdentitySnapshot, InductionStatus, InductionStore, InteractionRecord, InvalidBirthSignatureError, type Iso42001ControlId, JungianArchetype, JungianProfile, LimboReturn, LimboState, LimboTransition, LocalMaic, type LocalMaicConfig, META_AXIOM_ID, type MaicClient, MaicVerdict, MemoryRecord, type MintAxiomRequest, NatalChart, NatalChartAspect, NatalChartPosition, NatalPlanet, NheBodyRef, type NheLifecycleRequest, NheStatus, type NheStatusFilter, NheStatusRecord, NheStatusStore, type OntologicalKernel, type ProjectKernelOptions, type ProposalDecisionRequest, type ProposalListFilter, ProposalStatus, ProposalStore, ReasoningStep, type ReincarnationLifecycle, type ReincarnationRequest, RemoteMaic, type RemoteMaicConfig, type RetentionDecision, type RetentionReport, type RetentionReportOptions, type RetentionStatus, ReviewPipeline, type RuleMatch, type RulePack, SEED_AXIOMS, SEED_NONCE_BASE, SIGNED_BIRTH_FIELDS, type SeedResult, SemioticPattern, SemioticSign, type SignedBirthField, type SignedBirthSignature, TeleologicalOrientation, VerdictKind, WakeAffectBias, ZodiacSign, assertBirthSignature, canonicalJSON, evaluateRetention, projectOntologicalKernel, signBirthSignature, signedBirthPayload, verifyBirthSignature };
|