feat: wire the inventory domain through the stack - #36
Merged
Conversation
The second synthetic domain is now reachable end to end, not just in the rail: policy evaluation, execution, same-case review, export, and offline replay. - `aas demo --domain refund|inventory` (default refund) selects the domain fixture for decide and the rail demo for act; unknown domains are rejected before any stage runs. - Inventory fixtures added (policy plus pass/fail responses). The two domains keep separate policy references and separate remedy scope fields, so an allocation never passes as a refund. - stack-lock.json moves consequence-rail to the reviewed inventory-domain merge (6c61e9f); other pins unchanged. - Integration proof covers an inventory run with duplicate allocation and rail review, asserting flow, prove mode, compensation, policy reference, and provenance.
There was a problem hiding this comment.
Devin Review found 2 potential issues.
2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)
Comment on lines
+1470
to
+1472
| const domain = option(args, "--domain", "refund"); | ||
| if (!DEMO_DOMAINS.has(domain)) { | ||
| throw new UsageError("--domain must be refund or inventory"); |
There was a problem hiding this comment.
🟡 Inventory unavailable in guided GUI
GUI requests never pass the new domain option to runDemo. The GUI request path neither exposes nor accepts it, so every GUI run remains a refund.
Prompt for agents
Wire the inventory domain through the guided GUI as well as the CLI. Add a refund/inventory selector in bin/aas-gui.mjs, include its value in the browser's /api/run query, allow and validate the domain query parameter in createGuiServer, and append --domain to the runDemo arguments. Add GUI server and page tests covering inventory selection and rejection of unknown values.
Was this helpful? React with 👍 or 👎 to provide feedback.
Comment on lines
+581
to
+584
| const policyPath = join( | ||
| fixturesDir, | ||
| domain === "inventory" ? "inventory.policy.json" : "policy.json", | ||
| ); |
There was a problem hiding this comment.
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.
Capability (approved milestone 4, stack half)
The inventory domain is now reachable end to end, not only in the rail:
policy evaluation, execution, same-case review, export, and offline replay.
aas demo --domain refund|inventory(default refund) selects the domainfixture for decide and the matching rail demo for act; unknown domains are
rejected before any stage runs. Verified live: inventory settles, a duplicate
allocation compensates and reviews (
prove rail→ recorded, bound to theallocation action id), policy refusal stops execution, and the exported case
replays offline with all checks passing.
Boundaries
Each domain keeps its own policy reference and its own remedy scope field
(
max_amount_minorfor refunds,max_quantityfor allocations), so anallocation never passes as a refund. Nothing is labeled as AP2/UCP evidence,
and no warehouse, merchant, payment, or external provider is involved: a
recorded review proves the handoff, not real-world reversibility.
Verification
npm test: 105/105 (4 new: domain threading through decide/act, unknowndomain rejection, rail demo targeting, domain policy fixture).
npm run integration: exit 0, now asserting an inventory run withduplicate allocation plus rail review (flow, prove mode, compensation,
policy reference, provenance).
npm run test:browser: 9/9 unchanged.