Skip to content

feat(simulator): vertical pack loader with extension-field overlays (#31) - #79

Merged
flyworker merged 1 commit into
mainfrom
feat/sdk-31-pack
Aug 1, 2026
Merged

feat(simulator): vertical pack loader with extension-field overlays (#31)#79
flyworker merged 1 commit into
mainfrom
feat/sdk-31-pack

Conversation

@flyworker

Copy link
Copy Markdown
Contributor

Closes #31. Lets a vertical keep its own archetype + rubric catalog in its own repo, without forking the SDK or bloating examples/. Composes with #30 (packs carry rubrics alongside archetypes).

Surface (libraos.simulator)

  • Pack.archetypes / .rubrics enumerate; .get(name) → Archetype, .get_rubric(name) → RubricCase, .get_extensions(name) → dict.
  • load_pack(path= | name= | git=) — local dir, pip-installed pack (via the libraos.simulator.packs entry-point group), or shallow git clone.
  • list_installed_packs(), detect_pack_collisions([...]) — reports content names owned by >1 pack, so a harness merging verticals can refuse ambiguous ids.
  • Extension-field overlay (compliance/overlay.yaml) — the anti-bloat primitive: the base Archetype stays strict and vertical-agnostic; a pack declares its own fields (type/enum/pattern, required/optional), and loading validates base + overlay, with extras read via get_extensions().
  • requires_sdk enforced against the installed version at load.
  • examples/simulator/reference-pack/ reference layout; docs/simulator.md "authoring a pack" section.

Acceptance criteria — all met

  • load_pack(name=|path=|git=)Pack
  • Pack.archetypes / .rubrics enumerate; .get / .get_rubric return validated models
  • Extension-fields composition validates archetype against base + overlay
  • list_installed_packs() (entry-point group libraos.simulator.packs)
  • Reference pack at examples/simulator/reference-pack/
  • docs/simulator.md updated
  • Tests: cross-pack collision, invalid extension type/enum/missing-required rejected, requires_sdk compat both ways

Notable finding

Building the reference pack surfaced a real YAML 1.1 boolean gotcha: unquoted ON/OFF/YES/NO parse as booleans, so a province enum like ON silently becomes true and fails the string check. Documented with a warning, and the reference pack shows the correct quoting — exactly the trap EqualDocs's real ON/QC/BC jurisdictions would hit.

Testing

  • 10 new tests; full suite 187 passed, zero regressions (the lone failure, test_generated_models_module_present, fails identically on main — needs codegen output).

🤖 Generated with Claude Code

https://claude.ai/code/session_011AchmiUQL4WopPLZj8vkxu

)

Lets a vertical keep its own archetype + rubric catalog in its own repo
without forking the SDK or bloating examples/. Composes with #30 (packs
carry rubrics too).

New (libraos.simulator):
- Pack: .archetypes / .rubrics enumerate; .get(name) -> Archetype,
  .get_rubric(name) -> RubricCase, .get_extensions(name) -> dict.
- load_pack(path= | name= | git=): local dir, pip-installed pack via the
  'libraos.simulator.packs' entry-point group, or shallow git clone.
- list_installed_packs(); detect_pack_collisions([...]) reports content
  names owned by >1 pack (refuse ambiguous ids when merging verticals).
- Extension-field overlay (compliance/overlay.yaml): the anti-bloat
  primitive. Base Archetype stays strict/vertical-agnostic; a pack
  declares its own fields (type/enum/pattern, required/optional) and
  loading validates base + overlay, extras read via get_extensions().
- requires_sdk enforced against the installed version at load.
- examples/simulator/reference-pack/ reference layout; docs/simulator.md
  'authoring a pack' section.

Building the reference pack surfaced a real YAML 1.1 gotcha: unquoted
ON/OFF/YES/NO parse as booleans, so province enums like ON must be
quoted — documented, and the reference pack shows correct quoting.

Testing: 10 tests (reference pack, extension valid/bad-type/enum/
missing-required, version compat both ways, cross-pack collision, arg
guard, discovery). Full suite 187 passed, zero regressions.

Fixes #31

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011AchmiUQL4WopPLZj8vkxu
@flyworker
flyworker merged commit e9747c6 into main Aug 1, 2026
3 checks passed
@flyworker
flyworker deleted the feat/sdk-31-pack branch August 1, 2026 01:20
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.

feat(simulator): vertical pack loader (archetype + rubric packs from partner repos)

1 participant