Skip to content

fix(serialization): emit the holon from xbrlkit through the bundle bridge - #1373

Merged
jfrench9 merged 1 commit into
mainfrom
bugfix/holon-through-xbrlkit
Sep 9, 2026
Merged

fix(serialization): emit the holon from xbrlkit through the bundle bridge#1373
jfrench9 merged 1 commit into
mainfrom
bugfix/holon-through-xbrlkit

Conversation

@jfrench9

@jfrench9 jfrench9 commented Sep 9, 2026

Copy link
Copy Markdown
Member

Summary

The platform's rdf/holon.py carried its own copy of the scene/boundary/projection partition, forked from the kernel xbrlkit now owns. It seeded the scene from facts alone, so every element reached only by an arc — an empty statement line, an abstract header — left the holon without its rs:Element and rendered without a label: 56 of the SaaS demo's 98 elements. xbrlkit's kernel had since fixed this (arc endpoints carried into #projection, dimensions, the rs:Report node); the fork never inherited it.

  • serialize_to_holon_jsonld is now to_holon(bundle_to_xbrl_model(bundle)) — the waist the Tavi flavor already reads through. The platform partition is deleted.
  • The DataBook converter (examples/_common/databook.py) reads the flat JSON-LD back through xbrlkit's reader and calls the same writer, and stamps the report id as the accession so the derived holon reads back like the API's.
  • The flat JSON-LD encoder — the synchronous publish path — is untouched.
  • The tracked demo sample saas-startup-demo.holon.jsonld is regenerated through the new path.

Verification

before after
rs:Element declared 42 98
arc endpoints referenced but undeclared 56 0
xbrlkit load — concepts / labelled 42 / 38 98 / 93
rs:Report node in #scene no yes
root IRI https://robosystems.ai/report/{id} unchanged

Facts are identical before and after (86, 84 numeric, no value differences). New tests pin the regression — every arc endpoint declared, xbrlkit reads back every bundle concept, the named graphs hang off the report IRI. tests/operations/serialization plus the download and publication-artifact tests: 230 passed.

This is the holon half of serialization-waist phase 3, pulled early by the defect; the JSON-LD half stays parked.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VQNt2hdNJqbJwfoSRshaXo

…idge

The platform's rdf/holon.py carried its own copy of the scene/boundary/
projection partition, forked from the kernel xbrlkit now owns. It seeded
the scene from facts alone, so every element reached only by an arc — an
empty statement line, an abstract header — left the holon without its
rs:Element and rendered without a label: 56 of the SaaS demo's 98. The
kernel had since fixed this (arc endpoints carried into projection,
dimensions, the Report node) and the fork never inherited it.

The holon flavor is now to_holon(bundle_to_xbrl_model(bundle)) — the
same waist the Tavi flavor reads through — and the DataBook converter
reads the flat JSON-LD back through xbrlkit's reader and calls the same
writer. One partition, one repo; the platform copy is deleted. The flat
JSON-LD encoder, the synchronous publish path, is untouched.

The root IRI is unchanged (https://robosystems.ai/report/{id}), so the
named graphs a DataBook declares keep their addresses. The regenerated
demo sample loads in xbrlkit with 98 concepts and 93 labels (was 42/38),
every arc endpoint declared. This is the holon half of the
serialization-waist phase 3, pulled early by the defect.

Claude-Session: https://claude.ai/code/session_01VQNt2hdNJqbJwfoSRshaXo
@github-actions github-actions Bot added the change:normal Normal change: automated review documented on the pull request before merge label Sep 9, 2026
@github-actions

github-actions Bot commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Change classification: normal — platform or application code changed.

A normal change carries a documented automated review on this pull request before merge, in place of a second human approver. The change-classification job requests that review and passes once it has been posted. Recorded by the change-classification job.

@jfrench9

jfrench9 commented Sep 9, 2026

Copy link
Copy Markdown
Member Author

@claude please review this PR

@claude

claude Bot commented Sep 9, 2026

Copy link
Copy Markdown

Claude finished @jfrench9's task in 3m 59s —— View job


Reviewing PR #1373

  • Gather PR metadata, diff, and existing feedback
  • Review robosystems/operations/serialization/rdf/holon.py
  • Review examples/_common/databook.py
  • Review test changes
  • Review regenerated sample JSON-LD
  • Post final review

PR Summary

Title: fix(serialization): emit the holon from xbrlkit through the bundle bridge
Author: jfrench9 | Branch: bugfix/holon-through-xbrlkitmain
Changes: +5217 / -3574 across 4 files (mostly the regenerated fixture)

Deletes the platform's forked scene/boundary/projection partition (partition_report_graph / build_holon_dataset / serialize_holon_jsonld_from_graph) from holon.py and replaces it with a single call through the existing bundle→XbrlModel bridge (bundle_to_xbrl_model, already used by the Tavi flavor) into xbrlkit's to_holon. The demo databook.py converter is updated to read the flat JSON-LD back through xbrlkit's from_holon_json and call the same writer, patching in the report id as accession so the derived holon's IRIs match the API's. The flat JSON-LD encoder is untouched.

Existing Review Feedback

No human or bot reviews yet beyond the automated change-classification notice (this is a "normal" change, documented review required before merge). CI (Test CI, PR #1373) was still in progress at review time — I could not confirm the "230 passed" figure from the PR description independently since this sandbox blocks running uv/pytest/network gh calls; verification below is by static reading plus inspecting the regenerated fixture.

My Review

Issues (should fix before merge)

None found.

Suggestions (non-blocking)

  1. examples/_common/databook.py:567 feeds the flat (non-dataset-form) JSON-LD text straight into xbrlkit's from_holon_json, which reads by name like it expects the partitioned holon shape. It evidently works — the regenerated saas-startup-demo.holon.jsonld fixture is correct (verified: rs:Report lands in #scene, all three named graphs present, arc endpoints declared) — but the name mismatch is a little surprising for a future reader. Not this PR's file to fix since it's xbrlkit's naming, but a one-line comment noting that from_holon_json tolerates a flat/default-graph document too would save the next person a double-take.
  2. Old symbols (HOLON_GRAPHS, partition_report_graph, build_holon_dataset, serialize_holon_jsonld_from_graph) are cleanly removed with no dangling references anywhere in the repo (checked via grep) — good hygiene, nothing to do here, just confirming.

Verification performed

  • Confirmed bundle_to_xbrl_model / report_identifier in robosystems/operations/serialization/model.py are pre-existing (unchanged by this PR) and already used by the Tavi flavor — this PR is reuse, not new logic, consistent with CLAUDE.md's "operations kernel as single source of truth."
  • Confirmed no other call sites reference the deleted platform-partition functions.
  • Inspected the regenerated saas-startup-demo.holon.jsonld: three named graphs (#boundary, #projection, #scene) hang off https://robosystems.ai/report/rpt_01M1ZK1ZWEZ2Z01E1GX55PXWKH, and the rs:Report node is inside #scene (matches the PR's verification table).
  • Read the new/changed tests in tests/operations/serialization/test_jsonld_encoder.py: the fixture's AssetsCurrent concept is reachable only via a calculation arc (no fact), which is exactly the regression scenario described. test_every_arc_endpoint_is_declared asserts every arc from/to endpoint has a declared rs:Element; test_xbrlkit_reads_back_every_concept round-trips through from_holon_json and checks both concepts (not just the one with a fact) come back with the right label. These are real regression tests, not just green-by-construction.
  • examples/_common/databook.py's accession patch (model.filing.accession ← report id) is distinct from and complementary to the report_id= kwarg passed to to_holon — the former sets the accessionNumber literal on the rs:Report node, the latter scopes the graph-naming IRI. Both are set to the same value, which is the stated intent.

Questions

None — the description, diff, and regenerated fixture are internally consistent.

Verdict

APPROVE — the fix is a clean deletion of forked logic in favor of the shared kernel path, backed by tests that actually pin the regression (arc-only elements) rather than just re-asserting old behavior. No correctness, security, or layering issues found. Suggest waiting for CI to go green before merge (it was still running at review time).
· Branch

@jfrench9
jfrench9 merged commit 42ba41d into main Sep 9, 2026
8 checks passed
@jfrench9
jfrench9 deleted the bugfix/holon-through-xbrlkit branch September 9, 2026 23:42
jfrench9 added a commit that referenced this pull request Sep 9, 2026
#1373 replaced the platform's holon partition with xbrlkit's and
regenerated the SaaS demo's sample; the other four tracked samples
were still the old partition's output, each missing 52–59 element
declarations for the rows its arcs reach. Regenerated offline from
the flat JSON-LD beside each, through the DataBook converter — the
same path the SaaS sample took. Every arc endpoint is now declared
and each file reads back in xbrlkit with the report id as its
accession.

Claude-Session: https://claude.ai/code/session_01VQNt2hdNJqbJwfoSRshaXo
jfrench9 added a commit that referenced this pull request Sep 10, 2026
…refresh the demo samples

#1373 moved the holon onto xbrlkit's writer and, with it, lost the
identity the flat JSON-LD and the holon of one report had shared: the
flat bundle names structures, associations, Information Blocks and fact
sets by the platform's ids, xbrlkit slugged the role URI, and nothing on
the bridge carried the ids across. Periods, units and facts were fine.

The bridge now passes each network's structure_id and its fact set's id,
and each fact's structure pin, and xbrlkit (#48) writes them verbatim.
test_holon_alignment pins the invariant: every shared node class
identical between the two projections, every fact on the same structure
and fact set, IBs named by their structure; the only arcs the holon
lacks are the definition arcs the bridge does not carry.

All five demo sample sets are re-downloaded from one run each against
the rebuilt stack with xbrlkit #48 installed — the four artifacts and
the three reports per demo, from one report id — and pass a second
round of checks: flat-vs-holon IRI identity on every class, every arc
endpoint declared, the four representations agreeing on every shared
value, the holon a fixed point of read-then-write, SHACL and Arelle
clean. The old samples fail the same checks.

Needs the xbrlkit release carrying #48 and its chore(deps) bump before
CI can pass; opened as a draft until then.

Claude-Session: https://claude.ai/code/session_01VQNt2hdNJqbJwfoSRshaXo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

change:normal Normal change: automated review documented on the pull request before merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant