feat(simulator): vertical pack loader with extension-field overlays (#31) - #79
Merged
Conversation
) 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
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.
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/.rubricsenumerate;.get(name) → Archetype,.get_rubric(name) → RubricCase,.get_extensions(name) → dict.load_pack(path= | name= | git=)— local dir, pip-installed pack (via thelibraos.simulator.packsentry-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.compliance/overlay.yaml) — the anti-bloat primitive: the baseArchetypestays strict and vertical-agnostic; a pack declares its own fields (type/enum/pattern, required/optional), and loading validates base + overlay, with extras read viaget_extensions().requires_sdkenforced 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=)→PackPack.archetypes/.rubricsenumerate;.get/.get_rubricreturn validated modelslist_installed_packs()(entry-point grouplibraos.simulator.packs)examples/simulator/reference-pack/docs/simulator.mdupdatedrequires_sdkcompat both waysNotable finding
Building the reference pack surfaced a real YAML 1.1 boolean gotcha: unquoted
ON/OFF/YES/NOparse as booleans, so a province enum likeONsilently becomestrueand 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
test_generated_models_module_present, fails identically onmain— needs codegen output).🤖 Generated with Claude Code
https://claude.ai/code/session_011AchmiUQL4WopPLZj8vkxu