Skip to content

feat(poiesis-core): land B-001 envelope + factbase + open component registry - #4350

Merged
forkwright merged 2 commits into
mainfrom
feat/poiesis-b001-envelope
May 29, 2026
Merged

feat(poiesis-core): land B-001 envelope + factbase + open component registry#4350
forkwright merged 2 commits into
mainfrom
feat/poiesis-b001-envelope

Conversation

@forkwright

Copy link
Copy Markdown
Owner

Summary

  • Lands the typed core that today's poiesis-core lacks: DeliverableSpec envelope, Factbase (with Source/Claim/DAG resolver), open ComponentRegistry, typed Scalar/Unit/Money/AspectRatio/Tolerance, and parse-don't-validate identifier newtypes.
  • Additive only — pre-envelope Document/Block/Renderer surface preserved verbatim; organon keeps working unchanged (acceptance feat(ui): live tool activity feed, subtle abort, message queueing #5 covered).
  • Unblocks the Wave-2 fan-out (B-002 theme, B-003/B-004 deck, B-005 charts, B-007 workbook, B-008 QA, B-009 brief).

What lands (per planning/poiesis-evolution/B-001)

  • Envelope (envelope::DeliverableSpec): typed Meta with required-field enforcement, ThemeId (resolves via [[B-002]] registry), Factbase, and a Body sum over Deck/Document/Workbook.
  • Typed scalars (scalar): Scalar (Count/Money/Ratio/Text/Date), Unit (count/usd/percent/ratio/date/text), Money as i64 micro-units (no decimal-arithmetic dep), AspectRatio, Tolerance — no naked numbers reach the QA gate.
  • Typed identifiers (ids): ComponentId, ThemeId, FactId, ClaimId, SheetName, DataSourceId — charset and length enforced at construction; serde TryFrom rejects invalid.
  • Factbase (factbase): Fact, Source (Sql/Derived/Reference/Manual/File), Claim, citation-graph DAG resolver with cycle detection (returns the cycle path) and unsourced-reference detection. DataSource trait + DataSourceRegistry defined per the architecture contract; no in-tree adapters.
  • Open component registry (components): ComponentDef packs discovered from crates/poiesis/components/<id>/ (schema.json + recipe.toml + template.html.j2 + optional defaults/tokens). list_components() exposes the agent palette. Schema validation is a minimal in-crate JSON-Schema subset (type/required/properties/items/enum/minLength/maxLength); failure carries a JSON-pointer (RFC 6901).
  • Typed Artifact shape so render-side B-NNN entries have the output type ready when they evolve Renderer.

Acceptance (per B-001-poiesis-model-registry.md §Acceptance)

15 integration tests in crates/poiesis/core/tests/acceptance_b001.rs:

  1. Round-trip valid spec for each body kind (deck / workbook / document).
  2. Reject planted-bad specs with precise errors: missing required meta field, unknown component, bad slot type with JSON-pointer, unknown theme, citation cycle (path in error), unsourced claim.
  3. Drop-a-pack discovery: filesystem walk, schema validation, slot-validation rejection — no core recompile.
  4. Factbase resolves in declaration order, including Manual + Derived (Add/Sub/Div) + Reference; Sql skipped cleanly when no adapter configured.
  5. Legacy DocumentRenderer path compiles and produces bytes through a stand-in renderer; legacy Document wraps into DocumentBody.

Plus 54 unit tests across the new modules.

Scope discipline

Per R2 risk guidance: landed ONLY envelope + factbase + component-registry parse-don't-validate. Deferred to later waves:

  • Renderer trait evolution to render(&DeliverableSpec, &ResolvedTheme) → Artifact — owned by B-003/B-004 (render-side).
  • Pandoc-aligned DocBlock/Inline evolution — owned by B-006.
  • Second / worked component packs — owned by B-003/B-004 (the render entries that consume them).
  • Real DataSource adapter implementations — out of tree until a non-trivial consumer materializes.

Compatibility

organon is the only in-tree consumer of poiesis::Renderer. Verified: cargo check -p organon builds clean against this branch. The legacy Renderer::render(&Document) → Vec<u8> signature is untouched; the deprecation alias dance promised in §5.1 happens when the render-side B-NNN actually swap traits (next release, not this one).

Test plan

  • cargo test -p poiesis-core — 54 unit + 15 acceptance tests pass
  • cargo clippy -p poiesis-core --all-targets -- -D warnings — clean
  • cargo fmt --all -- --check — clean
  • cargo check -p organon — back-compat preserved
  • cargo check --workspace --features test-core --all-targets — clean
  • CI gate passes (Gate-Passed trailer will be stamped on green)

…egistry

Evolves `poiesis-core` from the closed-enum `Block` + `Renderer::render(&Document)`
surface into the typed model the rest of the poiesis-evolution cluster builds
on. Additive only — the pre-envelope `Document`/`Block`/`Renderer` surface is
preserved verbatim so organon keeps working unchanged.

What lands:

- `DeliverableSpec` envelope with typed `Meta`, `ThemeId`, `Factbase`, and a
  `Body` sum over `Deck`/`Document`/`Workbook`. Parse-don't-validate at every
  boundary; required-field misses surface a `SpecError::MissingMetaField`.
- Typed scalars and units: `Scalar` (Count/Money/Ratio/Text/Date), `Unit`
  (count/usd/percent/ratio/date/text), `Money` (i64 micro-units),
  `AspectRatio`, `Tolerance` — every numeric value is now tagged at the
  boundary; no naked f64 reaches the QA gate.
- Typed identifier newtypes: `ComponentId`, `ThemeId`, `FactId`, `ClaimId`,
  `SheetName`, `DataSourceId` — charset and length enforced at construction;
  serde rejects invalid via TryFrom.
- `Factbase` with `Fact`, `Source` (Sql/Derived/Reference/Manual/File),
  `Claim`, and a DAG resolver that detects cycles (returns the cycle path)
  and unsourced references before invoking any data adapter. `DataSource`
  trait + `DataSourceRegistry` are defined here per the architecture
  contract; no in-tree adapters ship.
- Open component registry: `ComponentDef` packs discovered from
  `crates/poiesis/components/<id>/` (schema.json + recipe.toml +
  template.html.j2 + optional defaults/tokens). `list_components()` enumerates
  the agent palette. Schema validation uses a minimal in-crate validator
  (type/required/properties/items/enum/minLength/maxLength); failure carries
  a JSON-pointer (RFC 6901) into the offending payload.
- Typed `Artifact` shape so render-side B-NNN entries have the output type
  ready when they evolve `Renderer`.

Acceptance (B-001 #1..#5): 15 integration tests in
`crates/poiesis/core/tests/acceptance_b001.rs` cover round-trip per body,
planted-bad rejection with JSON-pointer errors, drop-a-pack discovery, DAG
resolution with cycle/unsourced detection, and the legacy `Document` →
`Renderer` path still compiling and rendering through a stand-in renderer.

Unblocks the Wave-2 fan-out: B-002 theme registry (consumes `ThemeId`),
B-003/B-004 deck render (consume `Deck`/`Slide`/`ComponentRegistry`),
B-005 charts (consume `FactId`/`Cite`), B-007 workbook (consumes `Sheet`/
`WorkbookCell`/`Cite`), B-008 QA gate (consumes `Factbase`/`Claim`),
B-009 brief intake (produces seeded `DeliverableSpec`).

Refs: forkwright/aletheia planning/poiesis-evolution/B-001.
…ry land

Updates _llm/L3-api-index/poiesis-core.md and _llm/manifest.toml to
reflect the new public poiesis-core API surface (envelope, factbase,
component registry) added in the previous commit.

Generated via: uv run scripts/llm-extract-l3.py

Gate-Passed: kanon 0.1.0
@sonarqubecloud

Copy link
Copy Markdown

@forkwright
forkwright merged commit 0cb2bd3 into main May 29, 2026
9 checks passed
@forkwright
forkwright deleted the feat/poiesis-b001-envelope branch May 29, 2026 21:21
forkwright pushed a commit that referenced this pull request May 30, 2026
🤖 I have created a release *beep* *boop*
---


##
[0.30.0](v0.29.0...v0.30.0)
(2026-05-30)


### Features

* **aletheia:** faithful import consumer for
[#4163](#4163) (PR3/4)
([#4357](#4357))
([4e49dbe](4e49dbe))
* **aletheia:** populate working_state + typed knowledge in export
([#4163](#4163) PR2/4)
([#4351](#4351))
([702129e](702129e))
* **diaporeia:** wire memory.* MCP tools to organon executor
([#4117](#4117))
([#4352](#4352))
([7f2e243](7f2e243))
* **graphe:** portability raw entry points for
[#4163](#4163) (PR1/4)
([#4349](#4349))
([f267fe5](f267fe5))
* **poiesis-charts:** implement column + bar SVG emitters (B-005)
([#4368](#4368))
([3559002](3559002))
* **poiesis-charts:** implement line + area SVG emitters (B-005)
([#4372](#4372))
([2ca94ac](2ca94ac))
* **poiesis-charts:** implement pie + doughnut SVG emitters (B-005)
([#4371](#4371))
([996dbf3](996dbf3))
* **poiesis-charts:** implement scatter SVG emitter (B-005)
([#4369](#4369))
([6261c8b](6261c8b))
* **poiesis-charts:** implement stat KPI SVG emitter (B-005)
([#4374](#4374))
([1416fa0](1416fa0))
* **poiesis-charts:** implement Vega-Lite shell-out emitter (B-005)
([#4373](#4373))
([e6c9b70](e6c9b70))
* **poiesis-charts:** scaffold new crate per B-005
([#4318](#4318))
([fa2e374](fa2e374))
* **poiesis-core:** land B-001 envelope + factbase + open component
registry ([#4350](#4350))
([0cb2bd3](0cb2bd3))
* **poiesis-doc:** pandoc availability probe + flake.nix pin (B-014)
([#4361](#4361))
([d5efe1d](d5efe1d))
* **poiesis-doc:** scaffold Pandoc backend module, AST serializer, Lua
filter stubs (B-012)
([#4365](#4365))
([23dbe91](23dbe91))
* **poiesis-sheet:** wire B-007 workbook feature flag, error type, and
module declarations
([#4353](#4353))
([f6e574d](f6e574d))
* **poiesis-theme:** B-002 foundation — CSS byte-parity, OOXML
clrScheme+fontScheme, doc-vars, extended summus tokens
([#4370](#4370))
([b0c4319](b0c4319))
* **poiesis-theme:** base PPTX sink (B-002-B)
([#4378](#4378))
([f072bfe](f072bfe))
* **poiesis-theme:** LaTeX template sink (B-002-C)
([#4380](#4380))
([8cc683d](8cc683d))
* **poiesis-theme:** reference.docx sink (B-002-D)
([#4381](#4381))
([520a9b3](520a9b3))
* **poiesis-theme:** Typst template sink (B-002-C)
([#4379](#4379))
([cf48d61](cf48d61))
* **poiesis:** add chromium CDP printer for HTML-to-PDF conversion
([#4377](#4377))
([bd4e29e](bd4e29e))
* **poiesis:** add deck-layout solver and deck HTML/CSS renderer
([#4360](#4360))
([5aa1472](5aa1472))
* **poiesis:** add image-text, timeline, comparison, blank component
packs ([#4367](#4367))
([457efd7](457efd7))
* **poiesis:** add stat, quote, chart, table, image-full component packs
([#4366](#4366))
([4a3df26](4a3df26))
* **poiesis:** add title, section, bullet, two-col component packs
([#4356](#4356))
([dde8451](dde8451))
* **poiesis:** retire poiesis-text; migrate callers to poiesis-doc/typst
(B-013) ([#4354](#4354))
([f13df45](f13df45))


### Documentation

* **instance:** refresh stale v0.13.x version references to v0.29.0+
line ([#4347](#4347))
([01bc922](01bc922))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant