Skip to content

feat: wire the inventory domain through the stack - #36

Merged
EauDoon merged 1 commit into
mainfrom
feat/inventory-stack
Sep 6, 2026
Merged

feat: wire the inventory domain through the stack#36
EauDoon merged 1 commit into
mainfrom
feat/inventory-stack

Conversation

@EauDoon

@EauDoon EauDoon commented Sep 6, 2026

Copy link
Copy Markdown
Owner

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 domain
fixture 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 the
allocation 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_minor for refunds, max_quantity for allocations), so an
allocation 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, unknown
    domain rejection, rail demo targeting, domain policy fixture).
  • npm run integration: exit 0, now asserting an inventory run with
    duplicate allocation plus rail review (flow, prove mode, compensation,
    policy reference, provenance).
  • npm run test:browser: 9/9 unchanged.
  • Pin updated to the reviewed inventory merge (6c61e9f).

Devin Review

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 2 potential issues.

2 flags not posted on this PR by your GitHub settings — view them in Devin Review. (Configure)

Devin Review

Comment thread bin/aas.mjs
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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.
Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Comment thread bin/aas.mjs
Comment on lines +581 to +584
const policyPath = join(
fixturesDir,
domain === "inventory" ? "inventory.policy.json" : "policy.json",
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Unknown domains select refund policy

Direct callers passing a misspelled domain to runDecide silently receive the refund policy. Every value except inventory follows the refund branch, allowing the wrong policy decision.

Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

@EauDoon
EauDoon merged commit e3be31b into main Sep 6, 2026
10 checks passed
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