@wowok/agent-mcp 3.3.6 → 3.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chain-semantics/eval-order.js +1 -1
- package/dist/chain-semantics/field-capability.js +1 -1
- package/dist/chain-semantics/fund-flow.js +1 -1
- package/dist/chain-semantics/guard-verbs.js +1 -1
- package/dist/chain-semantics/object-graph.js +1 -1
- package/dist/communication/message-cursors.d.ts +35 -0
- package/dist/communication/message-cursors.js +1 -0
- package/dist/communication/wts-attestation.d.ts +5 -0
- package/dist/communication/wts-attestation.js +1 -1
- package/dist/composition/audit.js +1 -1
- package/dist/composition/compile.d.ts +3 -2
- package/dist/composition/compile.js +1 -1
- package/dist/composition/inflight.d.ts +7 -0
- package/dist/composition/inflight.js +1 -1
- package/dist/composition/materialize.d.ts +4 -1
- package/dist/composition/materialize.js +1 -1
- package/dist/config/index.d.ts +1 -0
- package/dist/config/index.js +1 -1
- package/dist/config/store-policy.d.ts +14 -0
- package/dist/config/store-policy.js +1 -0
- package/dist/config/store-policy.spec.d.ts +1 -0
- package/dist/config/store-policy.spec.js +1 -0
- package/dist/customer/industry-risks.js +1 -1
- package/dist/customer/user-preferences.js +1 -1
- package/dist/data/projection/facets.spec.js +1 -1
- package/dist/evaluation/builtins/graph-service.spec.js +1 -1
- package/dist/evaluation/engine.js +1 -1
- package/dist/evaluation/match-policy.d.ts +30 -6
- package/dist/evaluation/match-policy.js +1 -1
- package/dist/evaluation/match-policy.spec.js +1 -1
- package/dist/experience/realtime-feedback.js +1 -1
- package/dist/extensions/business-modules.d.ts +1 -1
- package/dist/extensions/business-modules.js +1 -1
- package/dist/extensions/industry-pack.js +1 -1
- package/dist/extensions/modes.js +1 -1
- package/dist/graph/onchain/analyze.js +1 -1
- package/dist/graph/onchain/expand.js +1 -1
- package/dist/graph/onchain/exposure.js +1 -1
- package/dist/graph/onchain/facts.d.ts +1 -0
- package/dist/graph/onchain/facts.js +1 -1
- package/dist/graph/onchain/facts.spec.js +1 -1
- package/dist/harness/recover.js +1 -1
- package/dist/intent/types.d.ts +1 -1
- package/dist/intent/types.js +1 -1
- package/dist/keeper/detectors.d.ts +3 -0
- package/dist/keeper/detectors.js +1 -1
- package/dist/keeper/keeper.spec.js +1 -1
- package/dist/knowledge/acquisition-flywheel.js +1 -1
- package/dist/knowledge/allocation-ledger.d.ts +1 -0
- package/dist/knowledge/allocation-ledger.js +1 -1
- package/dist/knowledge/allocator-rail-verifier.d.ts +6 -2
- package/dist/knowledge/allocator-rail-verifier.js +1 -1
- package/dist/knowledge/arbitration-ledger.js +1 -1
- package/dist/knowledge/audit-rules.d.ts +37 -0
- package/dist/knowledge/audit-rules.js +1 -1
- package/dist/knowledge/baselines/rules/plan.json +128 -3
- package/dist/knowledge/builtin-templates.d.ts +18 -1
- package/dist/knowledge/builtin-templates.js +1 -1
- package/dist/knowledge/commission-landing.d.ts +26 -0
- package/dist/knowledge/commission-landing.js +1 -0
- package/dist/knowledge/discount-threshold.js +1 -1
- package/dist/knowledge/event-semantics.js +1 -1
- package/dist/knowledge/fund-layer.d.ts +7 -0
- package/dist/knowledge/fund-layer.js +1 -1
- package/dist/knowledge/getting-started.js +1 -1
- package/dist/knowledge/guard-design-patterns.d.ts +1 -1
- package/dist/knowledge/guard-design-patterns.js +1 -1
- package/dist/knowledge/guard-puzzle.js +1 -1
- package/dist/knowledge/guard-render.d.ts +7 -0
- package/dist/knowledge/guard-render.js +1 -1
- package/dist/knowledge/guard-risk.js +1 -1
- package/dist/knowledge/guard-templates.d.ts +1 -1
- package/dist/knowledge/guard-templates.js +1 -1
- package/dist/knowledge/guard-translation.js +1 -1
- package/dist/knowledge/index.js +1 -1
- package/dist/knowledge/industry-generalizer.d.ts +4 -0
- package/dist/knowledge/industry-generalizer.js +1 -1
- package/dist/knowledge/industry-registry.d.ts +1 -1
- package/dist/knowledge/industry-registry.js +1 -1
- package/dist/knowledge/industry-strategy.js +1 -1
- package/dist/knowledge/jsonrpc-enum.js +1 -1
- package/dist/knowledge/machine-fork-watch.d.ts +9 -0
- package/dist/knowledge/machine-fork-watch.js +1 -0
- package/dist/knowledge/migration-preflight.js +1 -1
- package/dist/knowledge/projection.spec.js +1 -1
- package/dist/knowledge/scenario-modes.d.ts +8 -2
- package/dist/knowledge/scenario-modes.js +1 -1
- package/dist/knowledge/semantic-ir.d.ts +132 -0
- package/dist/knowledge/semantic-ir.js +1 -0
- package/dist/knowledge/service-ledger.js +1 -1
- package/dist/knowledge/strategy-manuals.js +1 -1
- package/dist/knowledge/template-index.js +1 -1
- package/dist/knowledge/template-loader.d.ts +45 -0
- package/dist/knowledge/template-loader.js +1 -1
- package/dist/knowledge/template-prose.d.ts +50 -0
- package/dist/knowledge/template-prose.js +1 -0
- package/dist/knowledge/template-registry.js +1 -1
- package/dist/knowledge/template-scanner.d.ts +5 -3
- package/dist/knowledge/template-scanner.js +1 -1
- package/dist/knowledge/template-validation.js +1 -1
- package/dist/knowledge/tools-reference.js +1 -1
- package/dist/monitor/MonitorLoop.js +1 -1
- package/dist/monitor/normalize.d.ts +1 -1
- package/dist/monitor/normalize.js +1 -1
- package/dist/monitor/types.js +1 -1
- package/dist/playbooks/service-build/business-puzzle.js +1 -1
- package/dist/playbooks/service-build/machine-panorama.js +1 -1
- package/dist/playbooks/service-build/merchant-guide.d.ts +16 -6
- package/dist/playbooks/service-build/merchant-guide.js +1 -1
- package/dist/playbooks/service-build/migration-planner.d.ts +11 -2
- package/dist/playbooks/service-build/migration-planner.js +1 -1
- package/dist/playbooks/service-build/mode-actions.d.ts +8 -0
- package/dist/playbooks/service-build/mode-actions.js +1 -1
- package/dist/playbooks/service-build/object-panorama.d.ts +22 -1
- package/dist/playbooks/service-build/object-panorama.js +1 -1
- package/dist/playbooks/service-build/participation-radar.js +1 -1
- package/dist/playbooks/service-build/relationship-profile.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping-nk4.spec.js +1 -1
- package/dist/playbooks/service-build/reverse-mapping.d.ts +1 -0
- package/dist/playbooks/service-build/reverse-mapping.js +1 -1
- package/dist/playbooks/service-build/service-panorama.js +1 -1
- package/dist/playbooks/service-build/service-quote.js +1 -1
- package/dist/playbooks/service-build/service-quote.spec.js +1 -1
- package/dist/review/index.js +1 -1
- package/dist/safety/confirm-gate.js +1 -1
- package/dist/schema/benchmark-migration/index.d.ts +135 -10
- package/dist/schema/benchmark-migration/index.js +1 -1
- package/dist/schema/call/allocation.d.ts +3 -0
- package/dist/schema/call/allocation.js +1 -1
- package/dist/schema/call/arbitration.js +1 -1
- package/dist/schema/call/base.d.ts +32 -0
- package/dist/schema/call/bridge.d.ts +8 -0
- package/dist/schema/call/error-codes.d.ts +1 -1
- package/dist/schema/call/error-codes.js +1 -1
- package/dist/schema/call/order.js +1 -1
- package/dist/schema/call/reward.d.ts +10 -0
- package/dist/schema/call/reward.js +1 -1
- package/dist/schema/call/semantic.js +1 -1
- package/dist/schema/call/service.js +1 -1
- package/dist/schema/common/index.js +1 -1
- package/dist/schema/config/index.d.ts +24 -0
- package/dist/schema/config/index.js +1 -1
- package/dist/schema/evaluation/index.d.ts +152 -0
- package/dist/schema/evaluation/index.js +1 -1
- package/dist/schema/goal/index.d.ts +16 -0
- package/dist/schema/goal/planning.d.ts +29 -0
- package/dist/schema/goal/planning.js +1 -1
- package/dist/schema/industry-pack/index.d.ts +70 -0
- package/dist/schema/industry-pack/modes.d.ts +70 -0
- package/dist/schema/industry-pack/modes.js +1 -1
- package/dist/schema/intent-radar/index.d.ts +3 -0
- package/dist/schema/intent-radar/index.js +1 -1
- package/dist/schema/local/index.d.ts +80 -0
- package/dist/schema/local/index.js +1 -1
- package/dist/schema/messenger/index.d.ts +278 -1
- package/dist/schema/messenger/index.js +1 -1
- package/dist/schema/operations.d.ts +6 -0
- package/dist/schema/query/bi.d.ts +38 -0
- package/dist/schema/query/bi.js +1 -1
- package/dist/schema/query/index.d.ts +148 -47
- package/dist/schema/query/index.js +1 -1
- package/dist/schema/schema-version.js +1 -1
- package/dist/schema/service-clone/index.d.ts +17 -0
- package/dist/schema/service-clone/index.js +1 -1
- package/dist/schema-query-impl/index.js +1 -1
- package/dist/schemas/account_operation.output.json +8 -0
- package/dist/schemas/benchmark_migration_operation.output.json +296 -2
- package/dist/schemas/benchmark_migration_operation.schema.json +292 -7
- package/dist/schemas/bridge_operation.output.json +8 -0
- package/dist/schemas/config_operation.output.json +95 -0
- package/dist/schemas/config_operation.schema.json +16 -1
- package/dist/schemas/evaluation_operation.output.json +240 -0
- package/dist/schemas/evaluation_operation.schema.json +397 -1
- package/dist/schemas/goal_operation.schema.json +40 -10
- package/dist/schemas/index.json +1 -1
- package/dist/schemas/industry_pack_operation.output.json +90 -2
- package/dist/schemas/industry_pack_operation.schema.json +236 -0
- package/dist/schemas/intent_radar.output.json +2 -0
- package/dist/schemas/intent_radar.schema.json +1 -0
- package/dist/schemas/local_cache_operation.output.json +8 -0
- package/dist/schemas/local_history_operation.output.json +8 -0
- package/dist/schemas/local_info_operation.output.json +8 -0
- package/dist/schemas/local_mark_operation.output.json +8 -0
- package/dist/schemas/messenger_operation.output.json +609 -1
- package/dist/schemas/messenger_operation.schema.json +96 -1
- package/dist/schemas/onchain_events.output.json +281 -11
- package/dist/schemas/onchain_events.schema.json +5 -1
- package/dist/schemas/onchain_operations.output.json +8 -0
- package/dist/schemas/onchain_operations.schema.json +371 -10
- package/dist/schemas/onchain_operations_allocation.schema.json +10 -1
- package/dist/schemas/onchain_operations_arbitration.schema.json +1 -1
- package/dist/schemas/onchain_operations_guard.schema.json +318 -0
- package/dist/schemas/onchain_operations_order.schema.json +1 -1
- package/dist/schemas/onchain_operations_reward.schema.json +35 -1
- package/dist/schemas/onchain_operations_service.schema.json +6 -6
- package/dist/schemas/query_toolkit.output.json +305 -8
- package/dist/schemas/service_clone_operation.output.json +79 -0
- package/dist/tools/handlers/benchmark-migration.d.ts +15 -0
- package/dist/tools/handlers/benchmark-migration.js +1 -1
- package/dist/tools/handlers/config.js +1 -1
- package/dist/tools/handlers/evaluation.js +1 -1
- package/dist/tools/handlers/evaluation.spec.js +1 -1
- package/dist/tools/handlers/intent-radar.js +1 -1
- package/dist/tools/handlers/messenger.d.ts +1 -0
- package/dist/tools/handlers/messenger.js +1 -1
- package/dist/tools/handlers/onchain.d.ts +20 -1
- package/dist/tools/handlers/onchain.js +1 -1
- package/dist/tools/handlers/query.d.ts +1 -0
- package/dist/tools/handlers/query.js +1 -1
- package/dist/tools/handlers/service-clone.d.ts +18 -0
- package/dist/tools/handlers/service-clone.js +1 -1
- package/dist/tools/handlers/wip.js +1 -1
- package/dist/tools/registry/agent.js +1 -1
- package/dist/tools/registry/business.js +1 -1
- package/dist/tools/registry/query.js +1 -1
- package/dist/tools/wip-verify-ledger.d.ts +14 -0
- package/dist/tools/wip-verify-ledger.js +1 -0
- package/dist/tools/wrap.d.ts +4 -0
- package/dist/tools/wrap.js +1 -1
- package/package.json +2 -2
|
@@ -37,13 +37,32 @@
|
|
|
37
37
|
"fund_topup_present": "The plan carries a compensation_fund_add step",
|
|
38
38
|
"fund_topup_amount": "Sum of parseable (integer smallest-unit) top-up balances; absent when unparseable",
|
|
39
39
|
"fund_ceiling_breach": "The top-up is below the award ceiling (MAX_INDEMNITY_MULTIPLE x highest SKU price) — judged ONLY when both sides parse (PLAN-K2)",
|
|
40
|
+
"fund_concurrent_orders_coverable": "How many simultaneous ceiling-sized claims the fund can pay: floor(fund / (3x highest SKU)). The buy gate only covers 3x ONE order — concurrent claims beyond this count abort (E_COMPENSATION_NOT_MATCH) until a manual top-up (PLAN-K2, b6-11)",
|
|
40
41
|
"fund_ceiling_basis": "Human-readable basis used for the ceiling judgment",
|
|
41
42
|
"fund_ceiling_unverifiable": "A fund top-up exists but the ceiling could not be judged here (price or amount unparseable) — the publish-patch KL-K2 rule re-checks at the 3x largest-order basis (PLAN-K2 fallback, stated explicitly)",
|
|
43
|
+
"reward_bounty_amount": "Largest per-claim bounty across the plan's reward guard_add mounts (Fixed amounts, smallest units) — absent when the plan mounts no bounty (T-02, bsn7-tn-261026)",
|
|
44
|
+
"reward_funding_amount": "Sum of parseable reward-pool funding (coin_add steps on reward targets, smallest units)",
|
|
45
|
+
"reward_max_claims": "How many full-bounty claims the current funding can pay: floor(funding / bounty)",
|
|
46
|
+
"lowest_sku_price": "Cheapest POSITIVE SKU price on the plan's sales catalog (same two legal sites the PLAN-K2 ceiling parser reads; a 0-price SKU is dead stock, F-BS-76)",
|
|
47
|
+
"reward_scale_breach": "The bounty exceeds half the cheapest SKU price — every claimed order pays out more than the sale earns, a bounty-farm target (T-02; judged ONLY when both sides parse)",
|
|
48
|
+
"reward_scale_ratio_display": "Human-readable bounty-to-cheapest-SKU ratio",
|
|
49
|
+
"reward_scale_unverifiable": "A bounty mount exists but the catalog has no parseable price — the scale judgment is deferred, stated explicitly (T-02 fallback, never silence)",
|
|
50
|
+
"first_arb_exit_node": "First settled/refund-class node with an outgoing edge whose guard queries the arbitration promise family (arb.indemnity / arb.order / arb.status / order.dispute) — a post-settlement arbitration re-route (FUND-ZERO-01 judgment gate)",
|
|
51
|
+
"fund_arb_route_unfunded": "A post-settlement arbitration re-route exists AND the compensation pool is absent or deposits 0 — the ruling payout aborts 27 (E_COMPENSATION_NOT_MATCH), so the promised exit is dead by construction (FUND-ZERO-01)",
|
|
52
|
+
"entry_no_open_exit": "The order-landing node (entry-edge target) exits only through CLOSING time windows (Clock <= anchor legs, no opening leg, no unguarded alternative) — once a window closes nothing can advance the order and the entry escrow is locked (ENTRY-ABANDON-01, gf26 GF2-30)",
|
|
53
|
+
"entry_strand_node": "First stranded entry node name (ENTRY-ABANDON-01 judgment gate)",
|
|
54
|
+
"arb_promise_without_settle_rail": "A machine guard reads the arbitration ruling family while NO $ref-visible allocator row releases money on the ruling (none reads the family, none rides the ruling edge node-free, and the ruling edge's destination has no FUND-EXIT-01-style allocator coverage); guard_key-declared rails are plan-opaque and left to the freeze gate — the verdict moves state, never money (POST-ARB-SETTLE-01, gf26 GF2-31)",
|
|
55
|
+
"arb_promise_node": "First node whose exit edge carries the arbitration-promise guard (POST-ARB-SETTLE-01 judgment gate)",
|
|
56
|
+
"arb_key_plane_opaque": "The machine carries arbitration-promise guards while the allocator rail plane carries guard_key declarations — rails the $ref plane cannot verify, so the POST-ARB-SETTLE-01 verdict rule stays silent there by ruling; this shape is the freeze gate's red line: ARB-KEY-PLANE-01 fires high and preflightPlan refuses the publish until the keys resolve into structured guard steps (user ruling 2026-10-26)",
|
|
57
|
+
"arb_key_plane_node": "First node whose exit edge carries the arbitration-promise guard (ARB-KEY-PLANE-01 judgment gate)",
|
|
42
58
|
"repo_policy_keys_display": "Comma-joined policy names declared by the plan's repository create steps (present only when at least one policy exists — the REPO-GATE-KEY-01 judgment gate)",
|
|
43
59
|
"repo_gate_key_unbacked_count": "Composite where-query scans over a plan-local repository whose static key no declared policy uses (REPO-GATE-KEY-01, ZR-32)",
|
|
44
60
|
"first_repo_gate_key_unbacked": "First unbacked gate key, rendered as 'key' in guard 'step-id'",
|
|
45
61
|
"repo_gate_key_unbacked_display": "Comma-joined list of ALL unbacked gate keys",
|
|
46
|
-
"sales_step_present": "The plan materializes at least one sellable SKU (a service create with a non-empty sales list, or a configure step with method 'sales') — the order entry's existence predicate (PLAN-SALES-01)"
|
|
62
|
+
"sales_step_present": "The plan materializes at least one sellable SKU (a service create with a non-empty sales list, or a configure step with method 'sales') — the order entry's existence predicate (PLAN-SALES-01)",
|
|
63
|
+
"guard_reach_contradiction_count": "Root-AND-chain legs carrying proof-level structural unreachability (ordering interval crossing; == to two different numeric constants or to opposite Bools; == X conjoined with a strict ordering past X; same-binding self-comparison with a strict direction) — the guard predicate is unsatisfiable by construction (GUARD-REACH-01, S3 plane)",
|
|
64
|
+
"first_guard_reach_contradiction": "First contradiction, rendered as: guard 'step-id' (channel): OP X contradicts OP X — unsatisfiable",
|
|
65
|
+
"guard_reach_contradiction_display": "Semicolon-joined list of ALL proof-level unreachability contradictions in the plan's guard roots"
|
|
47
66
|
},
|
|
48
67
|
"rules": [
|
|
49
68
|
{
|
|
@@ -99,6 +118,74 @@
|
|
|
99
118
|
}
|
|
100
119
|
]
|
|
101
120
|
},
|
|
121
|
+
{
|
|
122
|
+
"rule_id": "FUND-ZERO-01",
|
|
123
|
+
"dimension": "fund_flow",
|
|
124
|
+
"trigger": "The machine routes a post-settlement arbitration re-route (an arbitration-promise guard — arb.indemnity / arb.order / arb.status / order.dispute — on an edge leaving a settled/refund-class node) while the compensation pool is never funded. service::compensation_claim pays the ruling from service.compensation_fund (service.move:589-602) and an underfunded pool aborts the payout with code 27 (E_COMPENSATION_NOT_MATCH, claim left unconsumed); the escrow behind a settled/refunded node is structurally drained, so with a zero or absent fund the promised exit is dead by construction (gf26-tn-261026 GF2-02: a 0-fund shop published and the buyer's only remedy had no money behind it).",
|
|
125
|
+
"cases": [
|
|
126
|
+
{
|
|
127
|
+
"when": { "all": [ { "field": "fund_arb_route_unfunded", "op": "truthy" }, { "field": "fund_topup_present", "op": "falsy" } ] },
|
|
128
|
+
"level": "critical",
|
|
129
|
+
"title": "Post-settlement arbitration re-route from '${first_arb_exit_node}' with NO compensation fund",
|
|
130
|
+
"description": "The plan gates an exit edge leaving '${first_arb_exit_node}' on an arbitration ruling. That ruling pays through service::compensation_claim, which draws ONLY from service.compensation_fund — this plan never creates one (no compensation_fund_add step). The escrow is already drained at that node, so the buyer's remedy has zero money behind it: the payout aborts with code 27 even when the ruling is valid.",
|
|
131
|
+
"mitigation": "Add a configure step with method 'compensation_fund_add' and a balance >= the largest single-order exposure (the award ceiling is 3x the order amount, arb.move MAX_INDEMNITY_MULTIPLE), or rebuild without the post-settlement arbitration edge so the remedy does not depend on the fund.",
|
|
132
|
+
"stakeholders": ["merchant", "customer"]
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"when": { "all": [ { "field": "fund_arb_route_unfunded", "op": "truthy" }, { "field": "fund_topup_present", "op": "truthy" }, { "field": "fund_topup_amount", "op": "eq", "value": 0 } ] },
|
|
136
|
+
"level": "critical",
|
|
137
|
+
"title": "Post-settlement arbitration re-route from '${first_arb_exit_node}' with a ZERO compensation fund",
|
|
138
|
+
"description": "The plan gates an exit edge leaving '${first_arb_exit_node}' on an arbitration ruling, and its compensation_fund_add step deposits 0 — the fund exists but pays nothing. compensation_claim aborts with code 27 (E_COMPENSATION_NOT_MATCH) on any payout attempt, so the promised exit is still dead by construction.",
|
|
139
|
+
"mitigation": "Raise the compensation_fund_add balance to a real amount (>= the largest single-order exposure; the chain award ceiling is 3x the order amount), or remove the arbitration-gated exit edge.",
|
|
140
|
+
"stakeholders": ["merchant", "customer"]
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
"rule_id": "ENTRY-ABANDON-01",
|
|
146
|
+
"dimension": "fund_flow",
|
|
147
|
+
"trigger": "The order-landing node — the target of the machine entry edge (prev_node \"\") — exits only through CLOSING time-window guards (logic_as_u256_lesser_or_equal[Clock, anchor], no opening leg, no unguarded alternative): once a window closes every forward aborts, nothing can advance the order, and the escrow taken at entry is locked by construction (gf26-tn-261026 GF2-30: a 7.65 WOW pledge entered by a second transaction with no abandon-refund edge; machines and guard tables freeze at publish, so the missing recovery edge cannot be added later). Dead-end entries (zero exits) belong to the dead-end scanner, not this rule.",
|
|
148
|
+
"cases": [
|
|
149
|
+
{
|
|
150
|
+
"when": { "field": "entry_no_open_exit", "op": "truthy" },
|
|
151
|
+
"level": "high",
|
|
152
|
+
"title": "Entry node '${entry_strand_node}' has no exit that opens after its window",
|
|
153
|
+
"description": "Every forward leaving '${entry_strand_node}' — the node orders land on at entry — is gated by a closing time window (Clock <= anchor) with no opening leg and no unguarded alternative. Once the window passes the guard aborts forever: the order can never advance, and the escrow collected at entry is locked with no abandon/refund path. This is the GF2-30 live loss shape (7.65 WOW); shipping it bakes the lockup in permanently.",
|
|
154
|
+
"mitigation": "Add a self-healing exit from '${entry_strand_node}' gated on an OPENING window (logic_as_u256_greater_or_equal[Clock, anchor] — the abandon/refund edge that fires when the claim window elapses) targeting a fund-bearing node, so the escrow always keeps an after-window path; or leave one exit unguarded / gated on an any-time condition.",
|
|
155
|
+
"stakeholders": ["merchant", "customer"]
|
|
156
|
+
}
|
|
157
|
+
]
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
"rule_id": "POST-ARB-SETTLE-01",
|
|
161
|
+
"dimension": "fund_flow",
|
|
162
|
+
"trigger": "A machine guard reads the arbitration ruling family (arb.indemnity / arb.order / arb.status / order.dispute) while no allocator row releases money on that ruling — none reads the family, none rides the ruling edge node-free, and the ruling edge's destination node is covered by no allocator in the FUND-EXIT-01 dual-shape semantics (pinned by an allocator guard, or node-free-covered by an unconstrained allocator guard mounted on one of its inbound edges — the canonical shape where the ruling re-routes the order into a node the plain refund allocator drains). Judged only on the $ref plane: plans whose allocator rows declare guards by key (guard_key — the template/migration emission) carry a rail plane invisible here and are left to the materialization freeze gate. arb.move rulings only write case state; the payout must exist as a plan rail, so with none the verdict changes state and the escrow never moves (gf26-tn-261026 GF2-31: a ruling that writes status but never releases the money).",
|
|
163
|
+
"cases": [
|
|
164
|
+
{
|
|
165
|
+
"when": { "field": "arb_promise_without_settle_rail", "op": "truthy" },
|
|
166
|
+
"level": "critical",
|
|
167
|
+
"title": "Arbitration promise at '${arb_promise_node}' with no ruling-gated settlement leg",
|
|
168
|
+
"description": "A guard on the forward out of '${arb_promise_node}' reads the arbitration ruling family, promising a ruling-driven outcome — but no allocator row releases money on that ruling: none reads the family, none rides the ruling edge, and the ruling edge's destination node has no allocator coverage (no pin, no node-free refund mount). When the verdict lands the machine changes state and the escrow stays put; the ruling moves nothing. Allocators freeze at publish, so the missing settlement leg cannot be added afterwards.",
|
|
169
|
+
"mitigation": "Add an allocator row that releases money on the ruling: either a guard reading the arbitration family (arb.order == the order, arb.indemnity some == true) with a payout sharing leg, or route the ruling edge into a node already drained by the refund/settlement rail (an allocator guard pins it, or a node-free allocator guard rides one of its inbound edges). Do not keep a state-only promise.",
|
|
170
|
+
"stakeholders": ["merchant", "customer"]
|
|
171
|
+
}
|
|
172
|
+
]
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
"rule_id": "ARB-KEY-PLANE-01",
|
|
176
|
+
"dimension": "fund_flow",
|
|
177
|
+
"trigger": "The machine carries arbitration-promise guards (arb.indemnity / arb.order / arb.status / order.dispute) while the allocator rail plane carries guard_key declarations (the template/migration emission shape) — rails the $ref plane cannot verify, so a settle leg hiding in a keyed row is invisible here. The POST-ARB-SETTLE-01 verdict stays silent on this shape by ruling (2026-10-26); this rule is the publish-door red line instead: the materialization freeze gate refuses the publish until the keys resolve into structured guard steps whose settle-rail coverage is plan-verifiable.",
|
|
178
|
+
"cases": [
|
|
179
|
+
{
|
|
180
|
+
"when": { "field": "arb_key_plane_opaque", "op": "truthy" },
|
|
181
|
+
"level": "high",
|
|
182
|
+
"title": "Arbitration promise at '${arb_key_plane_node}' rides an opaque guard_key rail plane",
|
|
183
|
+
"description": "A guard on the forward out of '${arb_key_plane_node}' reads the arbitration ruling family, promising a ruling-driven outcome — but this plan's allocator rails are (at least partly) declared by key (guard_key), so the $ref plane cannot verify that any rail releases money on the ruling: a settle leg hiding in a keyed row is invisible to the audit. The state-only verdict risk of POST-ARB-SETTLE-01 cannot be ruled out here, and a failed settle rail would strand the escrow with the verdict unable to move money — with no way to add the settlement leg after publish. This is a publish-door red line — the freeze gate refuses this shape.",
|
|
184
|
+
"mitigation": "Resolve each guard_key rail into structured guard steps (guardResolutions with kind 'template' or 'inline') before publish, so the settle-rail coverage becomes plan-visible and POST-ARB-SETTLE-01 can judge it; or re-route the ruling edge into a node drained by a $ref-visible allocator row.",
|
|
185
|
+
"stakeholders": ["merchant", "customer"]
|
|
186
|
+
}
|
|
187
|
+
]
|
|
188
|
+
},
|
|
102
189
|
{
|
|
103
190
|
"rule_id": "UNRESOLVED-GUARD-01",
|
|
104
191
|
"dimension": "composition",
|
|
@@ -163,13 +250,13 @@
|
|
|
163
250
|
{
|
|
164
251
|
"rule_id": "PLAN-K2",
|
|
165
252
|
"dimension": "fund_flow",
|
|
166
|
-
"trigger": "Compensation-fund sizing guidance (KL-K2 family, re-scoped by b6-11): an award is hard-capped at 3x the order amount at ruling time, so a fund below a planned case's ceiling turns a WON award into an unpayable one (the claim aborts and is NOT consumed). Per-order coverage is
|
|
253
|
+
"trigger": "Compensation-fund sizing guidance (KL-K2 family, re-scoped by b6-11, demoted to warning by sign-off 5 — dm-mtw-261027): an award is hard-capped at 3x the order amount at ruling time, so a fund below a planned case's ceiling turns a WON award into an unpayable one (the claim aborts and is NOT consumed). Per-order coverage is WARNED at buy time (each order is checked against 3x ITS OWN amount; the order still proceeds); the plan layer advises sizing on the typical single order instead of the priciest SKU — no cross-SKU subsidy.",
|
|
167
254
|
"cases": [
|
|
168
255
|
{
|
|
169
256
|
"when": { "field": "fund_ceiling_breach", "op": "truthy" },
|
|
170
257
|
"level": "medium",
|
|
171
258
|
"title": "Compensation fund tops up below the award ceiling (${fund_ceiling_basis})",
|
|
172
|
-
"description": "The plan tops the fund up to ${fund_topup_amount} (smallest units), but a ruling at the ceiling would abort the buyer's claim (E_COMPENSATION_NOT_MATCH) and the abort does NOT consume the claim — the buyer holds an unpayable win until a manual top-up, and the shop holds the reputational damage. Disclosure, not a blocker: under-covered ORDERS
|
|
259
|
+
"description": "The plan tops the fund up to ${fund_topup_amount} (smallest units), but a ruling at the ceiling would abort the buyer's claim (E_COMPENSATION_NOT_MATCH) and the abort does NOT consume the claim — the buyer holds an unpayable win until a manual top-up, and the shop holds the reputational damage. Disclosure, not a blocker: under-covered ORDERS proceed with a buy-time warning (the per-order gate was demoted to a warning by sign-off 5 — dm-mtw-261027), so a buyer CAN enter a knowingly under-covered order — quote-time disclosure (max_coverable_order) is the buyer's protection. Concurrency headroom: this pool can pay ${fund_concurrent_orders_coverable} simultaneous ceiling-sized claim(s) — concurrent claims beyond that abort until a manual top-up.",
|
|
173
260
|
"mitigation": "Raise the compensation_fund input toward the ceiling (${fund_ceiling_basis}). Sizing is per-order now: 3x the typical single order keeps any single ruling payable; above that only buys tolerance for CONCURRENT claims against the one per-Service pool.",
|
|
174
261
|
"stakeholders": ["merchant", "customer"]
|
|
175
262
|
},
|
|
@@ -183,6 +270,29 @@
|
|
|
183
270
|
}
|
|
184
271
|
]
|
|
185
272
|
},
|
|
273
|
+
{
|
|
274
|
+
"rule_id": "PLAN-REWARD-SCALE-01",
|
|
275
|
+
"dimension": "economics",
|
|
276
|
+
"trigger": "Review-bounty scale (T-02, bsn7-tn-261026): a per-claim bounty larger than the margin of the order that earns it makes the reputation rail a bounty-farm target — buyers (or sybil accounts) manufacture cheap orders, claim the bounty, and drain the pool; the shop pays out more per claim than the sale earns. The former template default (1000000000) was 50x a 0.02-WOW SKU and passed every audit silently. Compile now DERIVES the bounty (2% of the cheapest positive SKU, floored at 1 smallest unit); this rule judges explicit overrides and custom plans. Disclosure, not a blocker: a deliberate loss-leader bounty is a legal promotion.",
|
|
277
|
+
"cases": [
|
|
278
|
+
{
|
|
279
|
+
"when": { "field": "reward_scale_breach", "op": "truthy" },
|
|
280
|
+
"level": "medium",
|
|
281
|
+
"title": "Review bounty is ${reward_scale_ratio_display} — each claimed order pays out more than the sale earns",
|
|
282
|
+
"description": "The plan mounts a per-claim bounty of ${reward_bounty_amount} (smallest units) against a cheapest SKU of ${lowest_sku_price}: every claim consumes more pool than the order brought in, and the funded pool pays ~${reward_max_claims} such claim(s) before running dry. That is the exact bounty-farm shape (T-02): cheap orders in, bounty out, pool drained.",
|
|
283
|
+
"mitigation": "Lower the reward_claim_amount input, or raise the cheapest SKU price — the compile default (2% of the cheapest positive SKU) is the sanctioned starting point; keep explicit overrides under half the cheapest SKU price unless the over-size is a deliberate, disclosed promotion.",
|
|
284
|
+
"stakeholders": ["merchant"]
|
|
285
|
+
},
|
|
286
|
+
{
|
|
287
|
+
"when": { "field": "reward_scale_unverifiable", "op": "truthy" },
|
|
288
|
+
"level": "medium",
|
|
289
|
+
"title": "Review-bounty scale cannot be judged from the plan",
|
|
290
|
+
"description": "The plan mounts a per-claim bounty of ${reward_bounty_amount}, but the sales catalog carries no parseable price here (display forms need token decimals the plan layer does not have), so the bounty-to-price ratio is DEFERRED, not skipped — stated explicitly rather than passed silently (the audit-silent gap T-02 closes).",
|
|
291
|
+
"mitigation": "Provide numeric smallest-unit sales prices so the plan layer can judge the ratio; the quote face discloses the live bounty-to-cheapest-SKU ratio at basket time regardless.",
|
|
292
|
+
"stakeholders": ["merchant"]
|
|
293
|
+
}
|
|
294
|
+
]
|
|
295
|
+
},
|
|
186
296
|
{
|
|
187
297
|
"rule_id": "DUAL-RAIL-01",
|
|
188
298
|
"dimension": "fund_flow",
|
|
@@ -348,6 +458,21 @@
|
|
|
348
458
|
"stakeholders": ["merchant", "customer"]
|
|
349
459
|
}
|
|
350
460
|
]
|
|
461
|
+
},
|
|
462
|
+
{
|
|
463
|
+
"rule_id": "GUARD-REACH-01",
|
|
464
|
+
"dimension": "composition",
|
|
465
|
+
"trigger": "A guard's root AND chain carries a proof-level structural contradiction: an ordering interval crossing (>= 10 conjoined with <= 5, or equal bounds with a strict side like >= X with < X), an equality family contradiction (one channel asserted == to two different numeric constants or to opposite Bool constants, or == X conjoined with > X / < X), or a same-binding self-comparison with a strict direction (X > X / X < X). The predicate is unsatisfiable by construction: the guard can never pass, and every path it gates is permanently unreachable after publish (guards freeze at creation; S3 plane static reachability). Deliberately conservative — only proof-level classes are reported: query-vs-query legs across DIFFERENT bindings (e.g. allocation.balance >= order.amount) and runtime submission values are decided at runtime and are never reported here; OR branches and negation scopes are not conjunctive and are not descended.",
|
|
466
|
+
"cases": [
|
|
467
|
+
{
|
|
468
|
+
"when": { "field": "guard_reach_contradiction_count", "op": "gt", "value": 0 },
|
|
469
|
+
"level": "critical",
|
|
470
|
+
"title": "Guard predicate is self-contradictory: ${first_guard_reach_contradiction}",
|
|
471
|
+
"description": "All contradictions: ${guard_reach_contradiction_display}. Each is a proof, not a heuristic: two legs on the same channel demand impossible bounds at the same constant, so the guard evaluates false on every submission. Any forward, allocator row or claim rail gated by it is dead on arrival — and any escrow that can only leave through that path is stranded. Guards freeze at creation, so nothing can repair the predicate after publish.",
|
|
472
|
+
"mitigation": "Repair the predicate before creation: drop the redundant leg (keep the one that states the business intent — e.g. the window lower bound OR the upper bound, never a crossing pair), or correct the constant so the legs can both hold. If one leg was meant for a DIFFERENT state, split the guard per state instead of conjoining them.",
|
|
473
|
+
"stakeholders": ["merchant", "customer"]
|
|
474
|
+
}
|
|
475
|
+
]
|
|
351
476
|
}
|
|
352
477
|
]
|
|
353
478
|
}
|
|
@@ -14,6 +14,11 @@ export interface ArchetypeTemplate {
|
|
|
14
14
|
fee_params: Record<string, number | string>;
|
|
15
15
|
trust_mechanisms: string[];
|
|
16
16
|
keeper_dependencies: string[];
|
|
17
|
+
keeper_duty?: {
|
|
18
|
+
when: string;
|
|
19
|
+
action: string;
|
|
20
|
+
miss_consequence: string;
|
|
21
|
+
}[];
|
|
17
22
|
recommended_role: "merchant" | "supplier" | "both";
|
|
18
23
|
role_rationale: string;
|
|
19
24
|
differences: string[];
|
|
@@ -43,12 +48,24 @@ export interface ArchetypeTemplate {
|
|
|
43
48
|
acceptance_mode?: "none" | "milestone" | "contest" | "bounty" | "agent";
|
|
44
49
|
installment_mode?: "none" | "deposit_balance" | "milestone_n";
|
|
45
50
|
affiliate_mode?: "none" | "commission";
|
|
51
|
+
logistics_mode?: "none" | "carrier" | "merchant_managed" | "courier" | "pickup_point";
|
|
46
52
|
crowdfunding_mode?: "none" | "threshold" | "flexible";
|
|
47
53
|
}
|
|
48
|
-
export declare const BUILTIN_TEMPLATES_VERSION =
|
|
54
|
+
export declare const BUILTIN_TEMPLATES_VERSION = 122;
|
|
49
55
|
export declare const BUILTIN_TEMPLATES: ArchetypeTemplate[];
|
|
50
56
|
export declare const TEMPLATE_KEYWORDS: Record<string, string[]>;
|
|
51
57
|
export declare const TEMPLATE_TAGS: Record<string, string[]>;
|
|
58
|
+
export declare const DISCOVERY_VARIANT_TAGS: Record<string, string[]>;
|
|
59
|
+
export declare function discoveryTagsForTemplate(id: string): string[];
|
|
60
|
+
export declare const DISCOVERY_TAG_VOCABULARY: readonly string[];
|
|
61
|
+
export declare const DISCOVERY_PRODUCT_REFS: readonly string[];
|
|
62
|
+
export declare function isDiscoveryTag(tag: string): boolean;
|
|
52
63
|
export declare function getBuiltinTemplate(id: string): ArchetypeTemplate | undefined;
|
|
53
64
|
export declare function listBuiltinTemplates(): ArchetypeTemplate[];
|
|
54
65
|
export declare function validateBuiltinTemplateCatalog(entries?: ArchetypeTemplate[]): void;
|
|
66
|
+
export interface OnceSlotAdvisory {
|
|
67
|
+
template_id: string;
|
|
68
|
+
kind: "once_slot_254_on_reenterable" | "reenterable_rail_missing_period_key";
|
|
69
|
+
message: string;
|
|
70
|
+
}
|
|
71
|
+
export declare function auditTemplateOnceSlotArms(entries?: ArchetypeTemplate[]): OnceSlotAdvisory[];
|