Petra (legacy determinism layer) · petra
Owner-canonical OS model (2026-06-17), deprecating. "Canon position: there is no Petra-as-engine. The single governing rule of Mainland is the Cognitive Loop — the
method → executetransition that must clear an enforcement/validation gate.spec_os_model_canonicalmakes the Cognitive Loop 'the one rule.'" [src: wiki/reference/legacy-systems.md:12]
Content
Petra is the legacy name for the determinism layer of the HOS — "the explicit, codified set of laws every Cognitive Loop is checked against before it may proceed" [src: wiki/reference/petra-rules.md:6]. In canon it is superseded: the cognitive-loop is the one rule, and Petra is treated as "the legacy name for the determinism checks the Cognitive Loop already enforces. Folded into the Loop, not removed. (Flaw #1.)" [src: wiki/reference/legacy-systems.md:16]
Code reality (still live, deliberately): the gate remains wired in production. enforceMethodToExecute [src: HOS-Webdoc/web/src/lib/cogniloop/cogniloop-engine.ts:319] is reused by the above-ADK runtime's non-removable method_to_execute gate [src: HOS-Webdoc/web/src/lib/sapiens3/runtime/runner.ts:11-21], validating against the Petra ruleset registry. The registry defines 14 rules across four layers (verified 2026-07-10): K001–K006 (kernel: execution + render invariants — K001 "every action through DOOIT dispatch", K002 "every fetch through the DITTO gateway", K003 glass blur, K004 PADGateway, K005/K006 advisory render rules), S001–S003 (system: approval chain + payment), O001–O003 (mainOS: timing/concurrency), H001–H002 (hos: sovereignty — H001 = "100 fixed datans / 20 squads of 5 — no dynamic datan creation" [src: wiki/development/HANDOFF.md:143]) [src: HOS-Webdoc/web/src/lib/petra/ruleset-registry.ts:17-127]. validateAgainstPetra() collects violations, defaulting to the strict set [src: HOS-Webdoc/web/src/lib/petra/ruleset-registry.ts:152].
Handling rule: build-forward — "surfaced as legacy, folded into the canonical model over time, never ripped out" [src: wiki/reference/legacy-systems.md:4]. A Datan citing determinism rules should cite the Cognitive Loop as the authority and the Petra registry as the live enforcement mechanism.
Variants
| # | Definition (verbatim) | Source | Ruling | Status |
|---|---|---|---|---|
| A | "the Petra gate is wired in production — enforceMethodToExecute (rules K001–K004) in lib/petra/ruleset-registry.ts" | [src: wiki/reference/legacy-systems.md:14] | Doc drift on scope: the gate exists, but the registry carries more than K001–K004 (see C). The deprecation itself is ruled by OWNER-2026-06-17 | deprecated (scope understated) |
| B | "reference.ts inlines only K001-K004 and labels it 'the canonical K001-K004 set', but the cited real kernel ruleset defines 6 kernel rules (K001-K006) plus 9 more (15 total)" | [src: wiki/engines/cognis-and-kernels.md:128] (RUN-006 review) | Count drift: the live registry actually defines 14 rules (6 K + 3 S + 3 O + 2 H), not 15 — verified against the generated-1:1 source [src: HOS-Webdoc/web/src/lib/petra/ruleset-registry.ts:17-127] | variant (miscount) |
| C | The registry itself: K001–K006, S001–S003, O001–O003, H001–H002 — 14 PetraRule entries; petra-rules.md is "generated 1:1 from the code registry" | [src: HOS-Webdoc/web/src/lib/petra/ruleset-registry.ts:17-127] [src: wiki/reference/petra-rules.md:6] | Ground truth for rule content/count; canonical as a legacy record (the layer itself is deprecated per the owner-canonical model) | canonical record, deprecated concept |
Composition
- uses: dooit (K001 routes every action through DOOIT dispatch), ditto (K002 routes every fetch through the DITTO gateway), pad (K004 PADGateway wrap)
- used-by: cognitive-loop (the method→execute determinism gate reuses it), loop (every loop is validated), sapiens3 (runtime runner's non-removable gate), datan (H001 caps the fleet at 100 fixed datans / 20 squads)
See also
- cognitive-loop — the canonical "one rule" that subsumes Petra
- codex · cortex — the other legacy-but-live systems in the same ledger
- [Upstream wiki page](../../../wiki/reference/legacy-systems.md)