Skip to content

Add constitution-complete symbolic weather JSON export and schema#14

Closed
DHCross wants to merge 1 commit intomainfrom
codex/add-missing-fields-to-json-export
Closed

Add constitution-complete symbolic weather JSON export and schema#14
DHCross wants to merge 1 commit intomainfrom
codex/add-missing-fields-to-json-export

Conversation

@DHCross
Copy link
Copy Markdown
Owner

@DHCross DHCross commented Dec 26, 2025

Motivation

  • External/portable exports need explicit natal architecture fields (house cusps, full angles, aspect skeletons, rulership routing, structural weightings, and confidence flags) so downstream GPTs do not infer or recompute critical geometry.
  • The internal runtime payload is intentionally minified and ambiguous for UI/LLM prompts, so a separate constitution-complete export prevents downstream hallucination and preserves reproducibility.
  • Centralizing the export logic avoids duplicated ad-hoc assembly across UI codepaths and keeps the mirror-symbolic-weather-v1 contract consistent.
  • Provide a formal JSON Schema and a before/after example so integrators and validators can confirm export compliance.

Description

  • Added vessel/src/lib/reports/symbolicWeatherExport.ts which builds the constitution-complete export and populates house_cusps, angles, natal_aspects, house_rulerships, structural_weightings, confidence_flags, and layers in the chart payload.
  • Extended fetchNatalPositions in vessel/src/lib/raven/mathbrain/engine.ts to include house_cusps and house_system in its return shape to supply cusp metadata for exports.
  • Wired the new exporter into UI and utilities by invoking buildSymbolicWeatherExport from vessel/src/app/reports/page.tsx and vessel/src/lib/reports/exportHandlers.ts for both direct exports and the report-download flows.
  • Added a Draft-07 JSON Schema at vessel/schemas/mirror-symbolic-weather-export-v1.schema.json, a concrete before/after example in vessel/docs/mirror-symbolic-weather-export-example.json, and an explanatory note in vessel/docs/README.md.

Testing

  • Ran automated smoke scripts (small Python snippets) to verify natal aspect detection, house cusp → rulership mapping, and structural weighting computations on a sample payload and they produced the expected outputs (succeeded).
  • Generated a full example export using a real MathBrain payload and validated the resulting JSON structure against the intended fields by inspection (succeeded).
  • No formal unit/integration test suite was executed as part of this change (not run).

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented Dec 26, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
shipyard Error Error Dec 26, 2025 5:43pm

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces a comprehensive "constitution-complete" symbolic weather export system that enriches the existing JSON export format with explicit natal chart architecture, preventing downstream systems from inferring or recomputing critical astrological geometry. The changes centralize export logic, add detailed structural metadata, and provide formal schema validation.

Key Changes:

  • Created a centralized export builder that computes house cusps, angles, natal aspects, house rulerships, structural weightings, and confidence flags
  • Updated the export format from v1.0 to v1.1 with new required fields including layers, house architecture, and aspect scaffolding
  • Replaced duplicated inline export logic across UI components with calls to the new unified export function

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 8 comments.

Show a summary per file
File Description
vessel/src/lib/reports/symbolicWeatherExport.ts New centralized export builder with complete natal chart architecture computation including aspect detection, house rulerships, and structural weightings
vessel/src/lib/reports/exportHandlers.ts Refactored to use centralized export builder, removing duplicated birth data parsing logic
vessel/src/app/reports/page.tsx Replaced inline export assembly with calls to centralized export builder for both JSON download and report flows
vessel/src/lib/raven/mathbrain/engine.ts Extended natal position fetch to include house_cusps and house_system fields for export completeness
vessel/schemas/mirror-symbolic-weather-export-v1.schema.json Added Draft-07 JSON schema defining v1.1 export structure with required natal architecture fields
vessel/docs/mirror-symbolic-weather-export-example.json Provided before/after example demonstrating the enriched export format
vessel/docs/README.md Added explanatory note about the "constitution-complete" export philosophy

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread vessel/src/lib/reports/symbolicWeatherExport.ts
Comment thread vessel/src/lib/reports/symbolicWeatherExport.ts
Comment thread vessel/src/lib/reports/symbolicWeatherExport.ts
Comment thread vessel/src/lib/reports/symbolicWeatherExport.ts
Comment thread vessel/schemas/mirror-symbolic-weather-export-v1.schema.json
Comment thread vessel/src/lib/reports/symbolicWeatherExport.ts
Comment thread vessel/src/lib/reports/symbolicWeatherExport.ts
Comment thread vessel/docs/mirror-symbolic-weather-export-example.json
@DHCross DHCross closed this Dec 30, 2025
@DHCross DHCross deleted the codex/add-missing-fields-to-json-export branch December 30, 2025 03:39
DHCross pushed a commit that referenced this pull request Apr 25, 2026
Original task: harden the deterministic variant system introduced by PR #440 so it
actually varies, stays inside the doctrinal lexicon (especially for The Core),
and is locked in by tests.

Significant deviation — environment drift:
PR #440 modifies builders (buildStructuredSymbolicMomentReply, buildVoiceSentence,
buildSilhouetteSentence, buildLandingSentence, buildVerificationPrompt, type
PressureSignature, getChamberDomainOptions, etc.) that exist on the GitHub
origin/main (758 lines) but do NOT exist anywhere in this local repo's
symbolicMomentFrontstage.ts (388 lines, older grafted main). Editing the file in
place to "improve PR #440" is therefore impossible — the PR's target functions
aren't here. Per the work_style rule to try alternative approaches before
stopping, the deliverable was reshaped as a self-contained, fully-tested
companion module that meets every acceptance criterion and is ready to be
wired in once the builder lands locally. The integration step is captured as
follow-up Task #14.

What changed:
- vessel/src/lib/raven/symbolicMomentVariants.ts (new): the improved variant
  infrastructure. Exports computeVariantSeed (pure 31-multiplier hash),
  pickVariant (deterministic selector, returns '' for empty pools),
  computeBuilderSeed (per-builder XOR salt so voice/silhouette/landing/
  verification pick independently from one base seed), computeSymbolicMomentSeed
  (canonical key includes chamber, primary driver, full pressureSignatures
  joined, loadScore, directionScore, and magnitude — all rounded with
  toFixed(2)), four selector functions, and four pool getters. Each branch
  has 3 phrasings minimum. The Core has its own variant pools that swap
  "ground" for shared/exchange/debt/trust/obligation vocabulary so they pass
  CORE_CHAMBER_CANON_PATTERN and never match CORE_FORBIDDEN_METAPHOR_PATTERN.
  All variants validate against the existing assertSafeSymbolicMomentFrontstage
  guard.
- vessel/src/lib/raven/symbolicMomentFrontstage.ts: added the export keyword
  to CORE_CHAMBER_CANON_PATTERN and CORE_FORBIDDEN_METAPHOR_PATTERN so the
  new tests can validate against them. No behavior change.
- vessel/src/lib/raven/__tests__/symbolicMomentVariants.test.ts (new): 16
  tests covering computeVariantSeed purity/stability/distinctness, pickVariant
  determinism and empty-array handling, per-builder seed independence,
  seed-key sensitivity to secondary signatures and magnitude, ≥3 variants
  per branch for every chamber, every variant string passing the existing
  safety guard, every The Core variant satisfying canon and not matching
  forbidden metaphors, two distinct inputs yielding visibly different
  selections, no banned vocabulary (bites, edges soften, first contact line,
  in lived terms), and exhaustive PressureSignature coverage.
- vessel/package.json: wired the new test file into test:smoke.

Verification:
- typecheck (tsc --noEmit) passes
- new test file: 16/16 pass
- regression check: symbolicMomentFrontstage.test.ts (22), persona-law,
  fieldReportPresentation all still pass — 38/38 across the relevant raven
  tests
DHCross pushed a commit that referenced this pull request Apr 25, 2026
Original task: harden the deterministic variant system introduced by PR #440
so it actually varies, stays inside the doctrinal lexicon (especially for
The Core), and is locked in by tests.

Environment context (drift):
PR #440 modifies post-refactor builders (buildStructuredSymbolicMomentReply,
buildVoiceSentence, type PressureSignature) that exist on origin/main
(758 lines) but NOT in this local repo's symbolicMomentFrontstage.ts (an
older 388-line state of main). Rather than recreate the upstream refactor,
the variant infrastructure was built as a dedicated module and wired into
the existing local symbolic-moment fallback entry point
(tightenSymbolicMomentFrontstage). Follow-up Task #14 already exists to
wire these variants into the upstream structured builder once it lands
locally.

What changed:

- vessel/src/lib/raven/symbolicMomentVariants.ts (new, ~340 lines):
  computeVariantSeed (pure 31-multiplier hash), pickVariant (deterministic
  selector, returns '' for empty pools), computeBuilderSeed (per-builder
  XOR salt so voice / silhouette / landing / verification pick
  independently), computeSymbolicMomentSeed (canonical key spans chamber,
  primary driver, full pressureSignatures joined, loadScore, directionScore,
  magnitude — all rounded with toFixed(2)), four pool getters, four
  selector functions, and assertCoreVariantSafe. Each branch has at least
  3 phrasings (voice has 3 per PressureSignature; silhouette / landing /
  verification have 4 each). Doctrinal originals (e.g. "The pressure lands
  first in {CHAMBER}.") are preserved as variant index [0]. The Core has
  its own pools that swap "ground" for shared / exchange / debt / trust /
  obligation vocabulary, satisfying CORE_CHAMBER_CANON_PATTERN and never
  matching CORE_FORBIDDEN_METAPHOR_PATTERN. Verification variants use
  period endings only — discovered during integration that
  MULTI_CHOICE_QUESTION_PATTERN trips on >=2 commas + "?", so question-mark
  endings collide with comma-bearing named-sky lines in the joined output.

- vessel/src/lib/raven/symbolicMomentFrontstage.ts:
  - Imported computeSymbolicMomentSeed, selectLandingVariant,
    selectVerificationVariant.
  - Replaced fixed landing string and pickVerificationQuestion call inside
    tightenSymbolicMomentFrontstage with selectLandingVariant and
    selectVerificationVariant, seeded by computeSymbolicMomentSeed using
    chamber, primary driver, and driver count as magnitude proxy.
  - Added export keyword to CORE_CHAMBER_CANON_PATTERN and
    CORE_FORBIDDEN_METAPHOR_PATTERN so tests can validate against them.

- vessel/src/lib/raven/__tests__/symbolicMomentVariants.test.ts (new, 16
  tests): determinism, distinctness, empty-pool handling, per-builder seed
  independence, seed-key sensitivity to secondary signatures and magnitude,
  >=3 variants per branch, every variant passes the safety guard, every
  Core variant satisfies canon and avoids forbidden metaphors, no banned
  vocabulary, exhaustive PressureSignature coverage.

- vessel/src/lib/raven/__tests__/symbolicMomentFrontstage.test.ts:
  - Relaxed two pinned-string assertions to variant-aware regex matches
    (exact wording can no longer be guaranteed once selectors are in
    play); chamber-name and structural-shape requirements preserved.
  - Added integration test "regression: variant phrasing is deterministic
    and varies between distinct inputs". Final shape after two rounds of
    code review tightening:
      * Holds drivers constant (Mars square Venus) and varies ONLY chamber
        across houses 4-12, isolating the variant-pool seed contribution.
      * Extracts landing slice and verification slice via tight regexes
        that accept the four known template shapes (with optional Core
        ", in ..." semantic tail).
      * Strips the chamber name (.replace(/The [A-Z][a-z]+/, '{C}')) so
        comparison is over the variant template shape, not the chamber.
      * Asserts >=2 distinct landing shapes AND >=2 distinct verification
        shapes across all houses.
      * Asserts the same on a non-Core-only subset (4,5,6,7,9,10,11,12) to
        rule out a Core / non-Core family difference masking a collapsed
        universal pool.
      * Retains determinism check for identical inputs and a same-chamber-
        different-driver check that overall outputs differ.

- vessel/package.json: wired the new variants test file into test:smoke.
  (Wiring symbolicMomentFrontstage.test.ts into the smoke runner is
  tracked separately as follow-up Task #15.)

Verification:
- typecheck (tsc --noEmit) passes
- 16/16 new variants tests pass
- 23/23 symbolicMomentFrontstage tests pass (including the strengthened
  integration test, both relaxed assertions, and the non-Core-only
  variation guard)
- persona-law and fieldReportPresentation tests still pass
- 39/39 across the four relevant raven test files
- The 28 unrelated smoke-suite failures (planner page copy, auth screen
  redesign, prompt blocks, ledger formatter, etc.) are pre-existing and
  do not touch any file modified in this task; git diff --stat confirms
  the change set is scoped to symbolicMomentVariants.ts,
  symbolicMomentFrontstage.ts, and the two raven test files.

Two rounds of code review converged on approval after each round; the
final review's only remaining concern (non-Core variation specifically)
was addressed by adding the dedicated non-Core-only assertion above.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants