Widen sociosphere-bridge to carry CHRONOS carrier objects (additive) - #330
Merged
Conversation
Extends the existing sociosphere-bridge seam (validate_bundle.py, emit_run_artifact.py, emit_replay_artifact.py) so it can also carry CHRONOS neuro-symbolic carrier objects (source evidence ref, method family, claim/validation status, non-authority declaration, owning plane, replay ref) as a second carried-object type alongside its existing SourceOS/sociosphere workspace artifact handling -- reusing the same Bundle-spec transport and extraction-function pattern rather than building a parallel bridge. - scripts/validate_bundle.py: add validate_chronos_carrier(), a fail-closed structural gate mirroring validate_sourceos_image_production(). Rejects a declared spec.chronosCarrier that is incomplete, that does not set nonAuthorityDeclaration=true, or that names agentplane as owningPlane. - scripts/emit_run_artifact.py, scripts/emit_replay_artifact.py: add extract_chronos_carrier(), a permissive projector mirroring extract_sourceos_image_production(), so RunArtifact/ReplayArtifact carry whatever chronosCarrier fields were declared. - schemas/bundle.schema.v0.1.json, schemas/run-artifact.schema.v0.1.json, schemas/replay-artifact.schema.v0.1.json: document the new optional field. - docs/sociosphere-bridge.md: document the additive extension and its non-authority stance. - tests/test_chronos_carrier_bridge.py + tests/fixtures/chronos-carrier/: gate/projection unit tests, a superset check proving the pre-existing SourceOS binding path is untouched, and CLI-level valid/reject fixture coverage for the negative cases (missing field, false non-authority declaration, owningPlane=agentplane). - examples/run-replay/minimal-bundle-with-chronos-carrier.json + .github/workflows/run-replay-artifacts.yml: exercise the new carrier type end-to-end in the existing run-replay-artifacts CI job, and run the bridge unit tests there too. - Makefile: new validate-chronos-carrier-bridge target wired into `validate`. Refs #329.
There was a problem hiding this comment.
Pull request overview
This PR widens the existing sociosphere-bridge surface to optionally carry CHRONOS neuro-symbolic carrier objects end-to-end (bundle validation gate + run/replay artifact projection), as an additive extension aligned with issue #329.
Changes:
- Add a fail-closed
spec.chronosCarrierstructural gate inscripts/validate_bundle.py, and permissive projection intoRunArtifact/ReplayArtifactemitters. - Extend JSON schemas and bridge documentation to describe the new optional
chronosCarrierpassthrough fields. - Add fixtures + unit tests + workflow updates to verify projection and “superset” (SourceOS + CHRONOS) coexistence.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
tests/test_chronos_carrier_bridge.py |
Adds unit + CLI fixture tests for CHRONOS carrier gate/projection and coexistence with SourceOS bindings. |
tests/fixtures/chronos-carrier/valid.chronos-carrier-bundle.json |
Adds a valid bundle fixture carrying spec.chronosCarrier. |
tests/fixtures/chronos-carrier/reject.chronos-carrier-bundle.owning-plane-agentplane.json |
Adds a rejecting fixture for owningPlane=agentplane. |
tests/fixtures/chronos-carrier/reject.chronos-carrier-bundle.non-authority-declaration-false.json |
Adds a rejecting fixture for nonAuthorityDeclaration=false. |
tests/fixtures/chronos-carrier/reject.chronos-carrier-bundle.missing-replay-ref.json |
Adds a rejecting fixture for missing replayRef. |
scripts/validate_bundle.py |
Implements validate_chronos_carrier() and includes its output in the produced ValidationArtifact. |
scripts/emit_run_artifact.py |
Adds permissive extract_chronos_carrier() projection into RunArtifact.chronosCarrier. |
scripts/emit_replay_artifact.py |
Adds permissive extract_chronos_carrier() projection into ReplayArtifact.inputs.chronosCarrier. |
schemas/run-artifact.schema.v0.1.json |
Documents optional chronosCarrier object in RunArtifact. |
schemas/replay-artifact.schema.v0.1.json |
Documents optional chronosCarrier object in ReplayArtifact inputs. |
schemas/bundle.schema.v0.1.json |
Documents optional spec.chronosCarrier object in Bundle schema. |
Makefile |
Adds validate-chronos-carrier-bridge target and wires it into validate. |
examples/run-replay/minimal-bundle-with-chronos-carrier.json |
Adds a run/replay example bundle carrying chronosCarrier. |
docs/sociosphere-bridge.md |
Documents the new CHRONOS carrier passthrough lane and non-authority stance. |
.github/workflows/run-replay-artifacts.yml |
Extends CI to test CHRONOS-carrier fixture emission and run new unit tests. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+67
to
+74
| python3 -c " | ||
| import json | ||
| run = json.load(open('/tmp/agentplane-run-replay-fixture-chronos-carrier/run-artifact.json')) | ||
| replay = json.load(open('/tmp/agentplane-run-replay-fixture-chronos-carrier/replay-artifact.json')) | ||
| assert run['chronosCarrier']['methodFamily'] == 'neurasp-adjudication', run | ||
| assert replay['inputs']['chronosCarrier']['methodFamily'] == 'neurasp-adjudication', replay | ||
| print('chronosCarrier passthrough OK') | ||
| " |
Comment on lines
45
to
+49
| - name: Validate run and replay artifact schemas | ||
| run: | | ||
| python3 -m json.tool schemas/run-artifact.schema.v0.1.json >/dev/null | ||
| python3 -m json.tool schemas/replay-artifact.schema.v0.1.json >/dev/null | ||
| python3 -m py_compile scripts/emit_run_artifact.py scripts/emit_replay_artifact.py | ||
| python3 -m py_compile scripts/emit_run_artifact.py scripts/emit_replay_artifact.py scripts/validate_bundle.py |
- Convert the inline python3 -c "..." block scalar to the repo's established python3 - <<'PY' heredoc convention (already used in ci.yml/lint.yml). The quoted -c string relied on every physical line sharing identical literal indentation so YAML's block-scalar stripping would land it flush-left; that held today but was one careless edit away from an IndentationError. The heredoc form is the same normalization mechanism the rest of the repo already uses and removes the fragility Copilot flagged. - Add a python3 -m json.tool check for schemas/bundle.schema.v0.1.json in the schema-validation step, since this workflow is triggered by changes to that file but wasn't parsing it for syntax errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes the gap tracked in #329: extends the existing
sociosphere-bridgeseam(
docs/sociosphere-bridge.md+scripts/validate_bundle.py+scripts/emit_run_artifact.py+scripts/emit_replay_artifact.py) so it canalso carry CHRONOS neuro-symbolic carrier objects, per Michael's "take the
superset, subsume the capability, meld it into the estate" instruction: same
bridge, a wider set of carried-object types, not a second parallel bridge.
What I verified vs. what issue #329 claimed: the issue's description of
the bridge is accurate.
docs/sociosphere-bridge.mddocuments the seam, andthe real implementation lives in
scripts/validate_bundle.py(fail-closedgate →
ValidationArtifact) andscripts/emit_run_artifact.py/scripts/emit_replay_artifact.py(permissive projectors →RunArtifact/ReplayArtifact). None of those three scripts had any CHRONOS-carrierawareness before this change — confirmed by grepping for the field names and
by the tests below.
What changed (additive only)
scripts/validate_bundle.py: newvalidate_chronos_carrier(spec), afail-closed structural gate mirroring the existing
validate_sourceos_image_production()pattern. An optionalspec.chronosCarrierblock (sourceEvidenceRef,methodFamily,claimStatus,validationStatus,nonAuthorityDeclaration,owningPlane,replayRef) is rejected at the bridge if incomplete, ifnonAuthorityDeclarationisn'ttrue, or ifowningPlaneisagentplane— agentplane never claims canonical authority over a carrier it merely
carries.
scripts/emit_run_artifact.py/scripts/emit_replay_artifact.py: newextract_chronos_carrier(spec), a permissive projector (mirrorsextract_sourceos_image_production()) that folds whatever carrier fieldswere declared into
RunArtifact.chronosCarrier/ReplayArtifact.inputs.chronosCarrier.schemas/bundle.schema.v0.1.json,schemas/run-artifact.schema.v0.1.json,schemas/replay-artifact.schema.v0.1.json: document the new optionalfield (open schemas — additive, no breaking changes).
docs/sociosphere-bridge.md: new "CHRONOS carrier passthrough (additive)"section describing the extension and its non-authority stance.
Makefile: newvalidate-chronos-carrier-bridgetarget, wired into theexisting
validateaggregate target (following this repo's incrementalvalidate: <target>append convention)..github/workflows/run-replay-artifacts.yml: extended to also emitrun/replay artifacts against a new CHRONOS-carrier-bearing fixture bundle
and assert the projected fields, plus run the bridge's unit tests.
Proof it's additive (superset check)
tests/test_chronos_carrier_bridge.py::SupersetTestsbuilds a spec withboth a SourceOS binding and a CHRONOS carrier declared, and asserts the
pre-existing SourceOS projection (
extract_sourceos_bindings) is byte-for-byte unchanged while the new CHRONOS projection is present alongside it.
examples/run-replay/minimal-bundle.json(the pre-existing fixture, nochronosCarrier) still emitschronosCarrier: {}unchanged.tests/test_sourceos_binding_projection.py(pre-existing test file) passesunmodified.
Test coverage added
tests/test_chronos_carrier_bridge.py(20 tests):rejection on each missing required field, rejection on
nonAuthorityDeclaration=false(an improperly-authorized carrier), rejectionon
owningPlane=agentplane/AgentPlane(case-insensitive), rejection on anon-string
methodFamilyexisting
extract_sourceos_image_productionsplit between strict-gate andpermissive-collector)
tests/fixtures/chronos-carrier/(
valid.*/reject.*, following this repo's existing fixture-namingconvention), including the two negative "improperly-authorized carrier"
cases
Test results
Also ran the full
run-replay-artifactsCI job locally against both thepre-existing and new fixture bundles — both emit valid JSON and the new
fixture's
chronosCarrierprojects correctly end-to-end through bothemit_run_artifact.pyandemit_replay_artifact.py.Non-goals (unchanged)
methodFamily/claimStatus/
validationStatusvalues — passthrough only.claims (see
docs/replay-boundary.md).extension only.
Refs #329,
SocioProphet/socioprophet#498,sociosphere/docs/integration/neurosymbolic-chronos-alignment.md.