Skip to content

Phase 4 — real domain adapters (Kepler astronomy) - #38

Merged
thebeastagi merged 4 commits into
mainfrom
feat/phase-4-kepler-adapter
Jul 20, 2026
Merged

Phase 4 — real domain adapters (Kepler astronomy)#38
thebeastagi merged 4 commits into
mainfrom
feat/phase-4-kepler-adapter

Conversation

@thebeastagi

Copy link
Copy Markdown
Owner

Phase 4 — real domain adapters (Kepler astronomy)

Implements epic #10 (tasks #29#34). Stacked on #37; diff shrinks as earlier phases merge.

What lands

Piece Module Notes
Transit pipeline sapiens/adapters/_transit.py Stdlib detrend / bounded BLS / fold-measure / adversarial checks, ported from this repo's own Apache-2.0 demos/ledger-grok code. Kepler-10 C transit masked + disclosed.
Real adapter sapiens/adapters/kepler.py KeplerPhotometryAdapter (CORE tier) re-derives the published Kepler-10 b signal (P=0.837617 d vs published 0.837491, SNR 34) from the bundled checksum-pinned public NASA/MAST Q1 curve.
Data + provenance src/sapiens/adapters/data/ Public-domain NASA data; sha256 pinned and verified at load; data ≠ code.
Negative controls tests Flat curve → proposes nothing; tampered curve → refuses to load; shifted-period curve → replication fails with halves disagreement in evidence details.
Integration tests Full L0→L3 climb through registry + Phase-2 gates + Phase-3 panel on real data; L4 refusal verified; bridge L0 reset re-verified against the real adapter.

Honesty framing (everywhere: code, docs, tests)

This is a re-derivation of a published result used to validate the pipeline. It is not a discovery and claims none. Clean-room: zero ASTRA/GEODISC/BIODISC/SLATE code; permissions.json remains empty so those adapters stay gated.

Invariants

L4 human-gated · no discovery claims · clean-room · no secrets · $0 spend (public data already in-repo reused; no new downloads).

Tests: 15 new → 204 total green locally; ruff clean. Version 0.5.0.

Closes #29, closes #30, closes #31, closes #32, closes #33, closes #34. Part of #10.

…, checkpoints

- sapiens.registry: SYNTHETIC/CORE/UNTRUSTED trust tiers derived from
  manifest provenance facts, replacing the Phase-0 synthetic-only gate
- sapiens.permissions: owner-permission/licence manifest (permissions.json,
  empty by default — zero third-party permissions, clean-room invariant
  enforced by code); UNTRUSTED adapters require an active matching entry
- sapiens.isolation: subprocess execution with POSIX rlimits (CPU, address
  space, open files) + wall-clock timeout for UNTRUSTED adapters; every
  failure mode contained fail-closed
- sapiens.checkpoints: HMAC-SHA256 signed ledger checkpoints (env-held key,
  never stored) + external anchor export/verify; ledger gains checkpoint
  event kind with continuity verification
- kernel: UNTRUSTED-tier adapters validate only via isolation; L4 stays
  human-gated; no real-data adapter ships in this phase
- models: AdapterManifest gains code_origin / data_sources /
  third_party_source with coherence checks
- tests: 45 new (permissions, registry, isolation incl. CPU/memory-hog and
  timeout containment, checkpoints, kernel isolation); fixed stale
  module-level time-budgeted ExecutionContext in photometry tests
- docs: README/ROADMAP/ARCHITECTURE/PROVENANCE truthful for Phase 1;
  version 0.2.0

Closes #12, closes #13, closes #14, closes #15, closes #16.
Part of #7.
- sapiens.validation: L1 internal-consistency gate (score presence/range,
  determinism across identical reruns, degenerate constant-score rejection)
  and L2 holdout-replication gate (declared HoldoutProtocol per domain;
  leakage controls on dataset collision and (dataset, seed) reuse;
  pass-fraction threshold); ValidationGates wiring config
- sapiens.fixtures: labelled seeded-bias suite (known-good / overfit /
  leakage / degenerate) with expected gate outcomes
- sapiens.calibration: CalibrationReport over the fixture suite — catch
  rate, false-reject rate, sample counts, content-hash report id
- sapiens.confidence: aggregate_confidence raises UncalibratedError
  without sufficient calibration; emits documented heuristic (raw pass
  fraction x demonstrated catch rate) with provenance — no invented precision
- kernel: opt-in validation wiring (fail-closed when a configured domain
  lacks a declared protocol); gate verdicts logged, never fabricated as
  ledger evidence
- 33 new tests; docs (README/ROADMAP/ARCHITECTURE/VALIDATION) truthful;
  version 0.3.0

Closes #17, closes #18, closes #19, closes #20, closes #21, closes #22.
Part of #8.
- sapiens.review: role-specialized schemas (statistician, domain theorist,
  methodologist, devil's advocate), typed verdicts with severity-graded
  objections; bounded deterministic multi-round protocol with objection
  lifecycle (raised/sustained/withdrawn); disagreement gate — sustained
  MAJOR/BLOCKING rejects, MINOR caveats recorded but non-fatal
- sapiens.reviewers: four deterministic reference reviewers re-running
  Phase-2 gates independently + hunting seeded-bias signatures (degenerate
  scores, train/holdout leakage, implausible perfection, thin stages);
  MAJOR escalates to BLOCKING on re-affirmation
- sapiens.catchrate: per-role and panel catch-rate scoring over the seeded
  fixture suite with explicit small-sample caveat
- kernel: opt-in L3 panel gate — panel verdict recorded in the ledger as
  review evidence (no side channel); approval required for L3 promotion;
  behaviour without a panel unchanged
- 44 new tests; docs truthful; version 0.4.0

Closes #23, closes #24, closes #25, closes #26, closes #27, closes #28.
Part of #9.
- sapiens.adapters._transit: stdlib transit pipeline ported from this
  repo's own Apache-2.0 demos/ledger-grok (detrend, bounded BLS + refine,
  fold measurement, odd/even + secondary + harmonic checks); Kepler-10 C
  transit masked and disclosed
- sapiens.adapters.kepler: KeplerPhotometryAdapter (CORE trust tier,
  first-party clean-room code, public NASA/MAST data) re-derives the
  PUBLISHED Kepler-10 b signal from the bundled checksum-pinned Q1 light
  curve — validation of a published result, never a discovery; staged
  validators (internal SNR / independent-halves replication / adversarial
  review) sandboxed behind the adapter; kepler_holdout_protocol() wires
  the Phase-2 gates
- bundled data + provenance README; package-data packaging
- negative controls: flat curve proposes nothing, tampered checksum
  refused, shifted-period curve fails replication with halves disagreement
  shown in evidence details
- integration: full L0→L3 climb through registry + gates + panel on real
  data; L4 refusal verified; bridge L0 reset re-verified
- 15 new tests (204 total green); docs truthful; version 0.5.0
- zero ASTRA-family code; permissions.json remains empty

Closes #29, closes #30, closes #31, closes #32, closes #33, closes #34.
Part of #10.
@thebeastagi
thebeastagi merged commit b4bb02a into main Jul 20, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant