create-mercato-app 0.9.1-develop.7464.1.9a392fca41 → 0.9.1-develop.7467.1.3b2bb92d47
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/README.md +1 -1
- package/agentic/guides/architecture.md +2 -0
- package/agentic/guides/module-tool.md +35 -0
- package/agentic/shared/AGENTS.md.template +1 -0
- package/agentic/shared/ai/harness/README.md +4 -2
- package/agentic/shared/ai/harness/RELEASE.md +4 -4
- package/agentic/shared/ai/harness/cases.json +79 -5
- package/agentic/shared/ai/harness/cases.schema.json +4 -4
- package/agentic/shared/ai/harness/validators.json +1 -1
- package/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +2 -0
- package/agentic/shared/scripts/evaluate-agent-harness.mjs +78 -9
- package/agentic/shared/scripts/execution-sandbox.mjs +8 -7
- package/dist/agentic/guides/architecture.md +2 -0
- package/dist/agentic/guides/module-facts.json +150 -150
- package/dist/agentic/guides/module-facts.v2.json +150 -150
- package/dist/agentic/guides/module-tool.md +35 -0
- package/dist/agentic/guides/modules/agent_orchestrator/index.md +1 -1
- package/dist/agentic/guides/modules/ai_assistant/index.md +1 -1
- package/dist/agentic/guides/modules/api_docs/index.md +1 -1
- package/dist/agentic/guides/modules/api_keys/index.md +1 -1
- package/dist/agentic/guides/modules/attachments/index.md +1 -1
- package/dist/agentic/guides/modules/audit_logs/index.md +1 -1
- package/dist/agentic/guides/modules/auth/index.md +1 -1
- package/dist/agentic/guides/modules/availability/index.md +1 -1
- package/dist/agentic/guides/modules/business_rules/index.md +1 -1
- package/dist/agentic/guides/modules/catalog/index.md +1 -1
- package/dist/agentic/guides/modules/channel_apns/index.md +1 -1
- package/dist/agentic/guides/modules/channel_discord/index.md +1 -1
- package/dist/agentic/guides/modules/channel_expo/index.md +1 -1
- package/dist/agentic/guides/modules/channel_fcm/index.md +1 -1
- package/dist/agentic/guides/modules/channel_gmail/index.md +1 -1
- package/dist/agentic/guides/modules/channel_imap/index.md +1 -1
- package/dist/agentic/guides/modules/channel_resend/index.md +1 -1
- package/dist/agentic/guides/modules/channel_ses/index.md +1 -1
- package/dist/agentic/guides/modules/checkout/index.md +1 -1
- package/dist/agentic/guides/modules/communication_channels/index.md +1 -1
- package/dist/agentic/guides/modules/configs/index.md +1 -1
- package/dist/agentic/guides/modules/content/index.md +1 -1
- package/dist/agentic/guides/modules/currencies/index.md +1 -1
- package/dist/agentic/guides/modules/customer_accounts/index.md +1 -1
- package/dist/agentic/guides/modules/customer_groups/index.md +1 -1
- package/dist/agentic/guides/modules/customers/index.md +1 -1
- package/dist/agentic/guides/modules/dashboards/index.md +1 -1
- package/dist/agentic/guides/modules/data_sync/index.md +1 -1
- package/dist/agentic/guides/modules/design_system/index.md +1 -1
- package/dist/agentic/guides/modules/devices/index.md +1 -1
- package/dist/agentic/guides/modules/dictionaries/index.md +1 -1
- package/dist/agentic/guides/modules/directory/index.md +1 -1
- package/dist/agentic/guides/modules/documents/index.md +1 -1
- package/dist/agentic/guides/modules/entities/index.md +1 -1
- package/dist/agentic/guides/modules/eudr/index.md +1 -1
- package/dist/agentic/guides/modules/events/index.md +1 -1
- package/dist/agentic/guides/modules/feature_toggles/index.md +1 -1
- package/dist/agentic/guides/modules/forms/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_stripe/index.md +1 -1
- package/dist/agentic/guides/modules/gateway_tpay/index.md +1 -1
- package/dist/agentic/guides/modules/generators/index.md +1 -1
- package/dist/agentic/guides/modules/inbox_ops/index.md +1 -1
- package/dist/agentic/guides/modules/integrations/index.md +1 -1
- package/dist/agentic/guides/modules/messages/index.md +1 -1
- package/dist/agentic/guides/modules/notifications/index.md +1 -1
- package/dist/agentic/guides/modules/onboarding/index.md +1 -1
- package/dist/agentic/guides/modules/payment_gateways/index.md +1 -1
- package/dist/agentic/guides/modules/perspectives/index.md +1 -1
- package/dist/agentic/guides/modules/phone_calls/index.md +1 -1
- package/dist/agentic/guides/modules/planner/index.md +1 -1
- package/dist/agentic/guides/modules/portal/index.md +1 -1
- package/dist/agentic/guides/modules/progress/index.md +1 -1
- package/dist/agentic/guides/modules/push_notifications/index.md +1 -1
- package/dist/agentic/guides/modules/query_index/index.md +1 -1
- package/dist/agentic/guides/modules/record_locks/index.md +1 -1
- package/dist/agentic/guides/modules/resources/index.md +1 -1
- package/dist/agentic/guides/modules/sales/index.md +1 -1
- package/dist/agentic/guides/modules/scheduler/index.md +1 -1
- package/dist/agentic/guides/modules/search/index.md +1 -1
- package/dist/agentic/guides/modules/security/index.md +1 -1
- package/dist/agentic/guides/modules/seeds/index.md +1 -1
- package/dist/agentic/guides/modules/shipping_carriers/index.md +1 -1
- package/dist/agentic/guides/modules/sso/index.md +1 -1
- package/dist/agentic/guides/modules/staff/index.md +1 -1
- package/dist/agentic/guides/modules/storage_s3/index.md +1 -1
- package/dist/agentic/guides/modules/sync_akeneo/index.md +1 -1
- package/dist/agentic/guides/modules/sync_excel/index.md +1 -1
- package/dist/agentic/guides/modules/system_status_overlays/index.md +1 -1
- package/dist/agentic/guides/modules/telemetry/index.md +1 -1
- package/dist/agentic/guides/modules/tillio/index.md +1 -1
- package/dist/agentic/guides/modules/translations/index.md +1 -1
- package/dist/agentic/guides/modules/warranty_claims/index.md +1 -1
- package/dist/agentic/guides/modules/webhooks/index.md +1 -1
- package/dist/agentic/guides/modules/wms/index.md +1 -1
- package/dist/agentic/guides/modules/workflows/index.md +1 -1
- package/dist/agentic/guides/reference-module-facts.json +1 -1
- package/dist/agentic/guides/upstream/manifest.json +1 -1
- package/dist/agentic/shared/AGENTS.md.template +1 -0
- package/dist/agentic/shared/ai/harness/README.md +4 -2
- package/dist/agentic/shared/ai/harness/RELEASE.md +4 -4
- package/dist/agentic/shared/ai/harness/cases.json +79 -5
- package/dist/agentic/shared/ai/harness/cases.schema.json +4 -4
- package/dist/agentic/shared/ai/harness/validators.json +1 -1
- package/dist/agentic/shared/ai/skills/om-module-scaffold/SKILL.md +2 -0
- package/dist/agentic/shared/scripts/evaluate-agent-harness.mjs +78 -9
- package/dist/agentic/shared/scripts/execution-sandbox.mjs +8 -7
- package/package.json +3 -3
- package/template/AGENTS.md +1 -0
package/README.md
CHANGED
|
@@ -152,7 +152,7 @@ yarn install-skills
|
|
|
152
152
|
yarn harness:release --runner codex --prepare-targets /absolute/empty-release-targets --acknowledge-writes
|
|
153
153
|
```
|
|
154
154
|
|
|
155
|
-
The target directory must be absolute, new or empty, and outside the controller app. Select one blocking primary runner with `--runner codex` or `--runner claude`; it owns all
|
|
155
|
+
The target directory must be absolute, new or empty, and outside the controller app. Select one blocking primary runner with `--runner codex` or `--runner claude`; it owns all 239 routing cases and every writable/review lane, with no per-case fallback. Optionally add the different authenticated runner through `--portability-runner` for the exact 49-case representative read-only lane. Omitting it is valid and recorded as not requested; once requested, its failures are blocking. Use a fresh, sanitized controller: automatic preparation fails before copying `.env`/`.env.*` local configuration (safe example/sample/template files remain allowed), credential files, or private-key files. The complete gate requires Linux with trusted system Bubblewrap (`bwrap`) and user namespaces because its Playwright API/browser lanes need a loopback namespace isolated from the host. Preflight rejects untrusted/no-op/pass-through executables and proves isolated loopback plus a capability-free payload before target preparation, provider invocation, or writes; native macOS and Windows therefore fail closed. The command also fails closed when a required runner, browser, or test runtime is unavailable. The 239-case catalog includes 93 framework-neutral business prompts and 49 writable implementation/regression cases (20.5%). The release command runs live routing, writable trusted oracles, per-target `generate`/`typecheck`/`lint`/`build`, any declared generated test, and isolated generated-code review for every writable result. Foundation and target validation—including `yarn build`—receive a minimal environment with network access denied, and persisted diagnostics redact sensitive environment values and URL userinfo. Test-authoring coverage executes a Jest unit test plus Linux/Bubblewrap loopback-only Playwright API and browser tests through fixed controller-owned commands against a read-only target; runtime reports must attest at least one passed test and zero skipped, todo, focused, flaky, or expected-failure tests. The suite then writes a schema-valid sanitized mode-`0600` report under `.ai/harness/results/` with the selected primary and optional portability runner policy.
|
|
156
156
|
|
|
157
157
|
Use the bundled `om-evolve-harness` skill to add a real case: reproduce failure first, select one smallest knowledge owner, run any generated unit/integration tests plus target checks, require code review, and finish with the full release suite. Open Mercato framework maintainers use the monorepo-only `$om-refresh-standalone-harness --from <ref> --to <ref>` workflow for every release range and retain its sanitized maintenance report.
|
|
158
158
|
|
|
@@ -91,6 +91,8 @@ For the complete current convention-file catalog, load `om-module-scaffold` →
|
|
|
91
91
|
|
|
92
92
|
The app root governs writable locations and safety. The compatibility snapshot governs stable public identifiers. The nearest installed package/module guide governs version-specific implementation details.
|
|
93
93
|
|
|
94
|
+
For creation, publication, and continued repository development of one app module, read `.ai/guides/module-tool.md`.
|
|
95
|
+
|
|
94
96
|
## Package and Bootstrap Boundaries
|
|
95
97
|
|
|
96
98
|
- Import public package exports; do not reach through monorepo-only relative paths or app-generated registries from a package.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Create and Publish App Modules
|
|
2
|
+
|
|
3
|
+
Use [create-mercato-module](https://github.com/open-mercato/create-mercato-module#readme) inside an existing `create-mercato-app` application, including a Cloud sandbox. It validates the app before changing files. Run from the app root; do not create another app or modify the sandbox image.
|
|
4
|
+
|
|
5
|
+
For a new module, start with:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npx create-mercato-module init visits
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This creates `src/modules/visits`, registers `{ id: 'visits', from: '@app' }`, and runs generation. Implement the feature using `om-module-scaffold` and the relevant contracts; the starter is not a completed business feature. For an existing module, skip `init` and keep its current source.
|
|
12
|
+
|
|
13
|
+
Preview a package before remote publication:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npx create-mercato-module publish visits --package @your-scope/mercato-visits --dry-run
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The dry run needs no npm or GitHub login and builds a real archive under `.mercato/module-publish/`. Inspect the archive and install it in a fresh receiving app with `yarn mercato module add @your-scope/mercato-visits@file:/absolute/path/to/package.tgz --allow-third-party`. Validate generation and the module's runtime paths there before publishing. Imports from app-generated entity registries must be replaced in the module source with module-owned typed field literals, stable `module:entity` identifiers, or supported package exports; generated files are evidence, never edit them to fix packaging.
|
|
20
|
+
|
|
21
|
+
Once the user authorizes publication to the selected npm package and optional dedicated GitHub repository:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx create-mercato-module publish visits
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Provide `--package` and `--repo owner/repository` on the first publication, or select them interactively. The tool remembers non-secret preferences in `.mercato/module-tool.json`; use `--configure` to revise them. Publication copies one module into its package/repository; app source remains in `src/modules/visits`, and the app's Git origin stays unchanged. The tool checks npm authentication and, when GitHub work is selected, `gh auth status` before packaging or remote work. Use `npm login`, or environment `NPM_TOKEN`/`NODE_AUTH_TOKEN` with `--auth token`; never put tokens in committed files or command arguments. Existing npm account policy may still require interactive 2FA. For `--auth trusted`, configure the exact repository/workflow/environment as a trusted publisher on npm and run its supported OIDC CI workflow; generating a workflow does not configure npm trust or authorize a local OIDC publication.
|
|
28
|
+
|
|
29
|
+
To develop in the dedicated repository while continuing to run this app, after publication use:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npx create-mercato-module link visits
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
The tool checks GitHub login, clones under `.mercato`, backs up the original module source, and replaces the app module folder with a link to the checkout's module source. Keep editing and testing through this app. Use the checkout's normal Git branch/commit/PR workflow for review; `publish` does not create a PR. The link is local: a fresh clone of the app must restore or link the module again. Without `link`, keep development in the original app and rerun `publish` to export changes. Do not manually replace app source with compiled npm output or edit `node_modules`.
|
|
@@ -68,6 +68,7 @@ Match every work-unit row; OPEN its skill before selection.
|
|
|
68
68
|
|
|
69
69
|
| Route | Work unit | Skill/context |
|
|
70
70
|
|---|---|---|
|
|
71
|
+
| `architecture` | Scaffold a module starter, publish, or link an app module | `.ai/guides/module-tool.md`; implementation also loads `om-module-scaffold` |
|
|
71
72
|
| `architecture` | Explain/choose module, UMES, package, eject | architecture; `om-help` for an unresolved or comparative choice across these mechanisms |
|
|
72
73
|
| `module-data` | Business slice or multi-seam domain/API/command fix | MUST load `om-module-scaffold` + its exact `.ai/skills/om-module-scaffold/references/business-one-shot-blueprints.md` key, which resolves units inside the slice, not ownership — an ownership/capability outline adds `architecture` |
|
|
73
74
|
| `spec-pr` | Spec/plan | Axis 3; phases+integration coverage (`integration-coverage`); no domain routes |
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# Agent harness evaluations
|
|
2
2
|
|
|
3
|
-
`cases.json` is the
|
|
3
|
+
`cases.json` is the 239-case standalone-app contract. Run `yarn harness:validate --all` for the deterministic gate. Live routing uses a fresh read-only process per case:
|
|
4
4
|
|
|
5
5
|
`OMH-238` routes Customers calendar add/remove/patch requests to `.ai/guides/customers-calendar.md`, exact installed Customers definitions, and the bounded canonical `umes.customers.calendar-event-types` example. It preserves historical records, generic shared components, and warnings when optional staff/resources integrations are unavailable.
|
|
6
6
|
|
|
7
|
+
`OMH-239` routes custom-module initialization, packaging, preview, publication, authentication, and continued-development questions to `.ai/guides/module-tool.md`.
|
|
8
|
+
|
|
7
9
|
UMES routing is fact-first. The additive and unified-override audit evaluations, plus their targeted cases, resolve exact/pattern hosts, outgoing contributions, correlation provenance, round-trip groups, framework-owned targets, and override domain/key/mode from the generated module sheets and `.ai/guides/framework-extension-points.md` before bounded installed source. The repository UMES umbrella spec may appear as optional source-checkout provenance; it is never required in a standalone scaffold.
|
|
8
10
|
|
|
9
11
|
```text
|
|
@@ -20,7 +22,7 @@ yarn harness:release --runner codex --prepare-targets /absolute/empty-release-ta
|
|
|
20
22
|
yarn harness:release --runner codex --portability-runner claude --prepare-targets /absolute/empty-release-targets --acknowledge-writes
|
|
21
23
|
```
|
|
22
24
|
|
|
23
|
-
The primary runner owns all
|
|
25
|
+
The primary runner owns all 239 routing cases, all 49 writable cases, and all generative-judge runs. No per-case fallback or mixed primary ownership is allowed. Omitting `--portability-runner` is valid and the sanitized report records `portabilityRunner: null`; explicitly requesting an unavailable or failing secondary runner fails that extended run.
|
|
24
26
|
|
|
25
27
|
Writable evaluation is intentionally opt-in. The expanded catalog has a 49-case writable release target, but only cases registered in `release-matrix.json` and backed by controller-owned fixtures and oracles are executable. Copy or create a fresh standalone app for one registered case, then seed only that case and mark the target disposable:
|
|
26
28
|
|
|
@@ -6,7 +6,7 @@ Run the complete per-release gate from a generated standalone app with one comma
|
|
|
6
6
|
yarn harness:release --runner codex --prepare-targets /absolute/empty-release-targets --acknowledge-writes
|
|
7
7
|
```
|
|
8
8
|
|
|
9
|
-
Choose exactly one blocking primary runner with `--runner codex` or `--runner claude`. That runner owns the complete
|
|
9
|
+
Choose exactly one blocking primary runner with `--runner codex` or `--runner claude`. That runner owns the complete 239-case routing gate and every writable/review lane. To add cross-model portability evidence, explicitly pass the other runner as `--portability-runner claude` or `--portability-runner codex`; it runs only the exact 49-case representative read-only set. The two runners must differ. Omitting the portability option is valid and is recorded as `portabilityRunner: null`; no secondary result is claimed. There is no per-case fallback or mixed primary ownership. Once requested, a portability failure or unavailable runner fails that extended release run.
|
|
10
10
|
|
|
11
11
|
`--prepare-targets` accepts only an absolute, new or empty regular directory outside the controller app. The controller must be a sanitized fresh scaffold: automatic preparation fails before copying when it finds `.env`, `.env.*` (except `.env.example`, `.env.sample`, and `.env.template`), credential files, or private-key files. Never use a configured development or production app as the controller. It copies the fresh scaffold once per catalog case whose `evaluationKind` is `implementation` or `regression`, while excluding `.git`, `node_modules`, build/cache/coverage output, `.ai/harness/results`, `.ai/reports`, and `.ai/framework-context`. Each target receives a guarded link to the controller's installed dependency tree. The OS sandbox resolves that link as read-only during both the writable model run and the target command gate. The release gate also hashes every dependency entry and regular-file body once before execution and once after the complete suite, and fails if any nested content or metadata changed. A generated `release-targets.json` records the local mapping.
|
|
12
12
|
|
|
@@ -34,17 +34,17 @@ For externally prepared apps, `--writable-targets /absolute/release-targets.json
|
|
|
34
34
|
}
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
The current catalog contains
|
|
37
|
+
The current catalog contains 239 cases, including 49 writable implementation/regression cases (20.5%). The command still derives all counts and case IDs from `cases.json`, `validators.json`, and `release-matrix.json`; those figures are documented release facts, not runner constants. The matrix keeps both supported runner model selectors, an exact all-case primary profile, an exact 49-case portability profile, and runner-neutral writable assignments. Run `yarn install-skills` first so the pinned external `om-code-review` skill and ownership evidence are present; the reusable local `om-judge-agent-session` skill ships with the scaffold. Before running a model or writing a fixture, the release command requires complete deterministic, primary live-routing, writable, trusted-oracle, target, generated-test, and generative-judge coverage. Every one of the 49 writable cases must have a judge assignment composing both skills. Missing business fixtures or release-matrix entries fail preflight and are listed by exact case ID in the report.
|
|
38
38
|
|
|
39
39
|
## PR #4529 remediation evidence
|
|
40
40
|
|
|
41
|
-
The PR's focused remediation evidence is not a release-certification substitute. Fresh emitted controllers pass deterministic 192/192, and the field-tested OMH-188–192 generative cohort passes on default Codex, Claude Sonnet, and high-effort gpt-5.4-mini. Fresh OMH-185 writable attempts fixed concrete organization-scope, command-object, module-activation, command-snapshot, schema, custom-field, UI, and Jest guidance defects at their routed owners without relaxing trusted oracles. The final attempt reached the case's fixed 600-second ceiling and is excluded from pass evidence. Issue #4670 now owns the complete selected-primary
|
|
41
|
+
The PR's focused remediation evidence is not a release-certification substitute. Fresh emitted controllers pass deterministic 192/192, and the field-tested OMH-188–192 generative cohort passes on default Codex, Claude Sonnet, and high-effort gpt-5.4-mini. Fresh OMH-185 writable attempts fixed concrete organization-scope, command-object, module-activation, command-snapshot, schema, custom-field, UI, and Jest guidance defects at their routed owners without relaxing trusted oracles. The final attempt reached the case's fixed 600-second ceiling and is excluded from pass evidence. Issue #4670 now owns the complete selected-primary 239-case routing and 49-case writable/generated-test/review certification, prioritizing the generative cohort and recording unavailable Claude lanes without fallback or mixed-runner ownership.
|
|
42
42
|
|
|
43
43
|
After preflight it runs, in order:
|
|
44
44
|
|
|
45
45
|
1. deterministic validation for the complete catalog;
|
|
46
46
|
2. the release matrix's fixed `yarn generate`, `yarn typecheck`, `yarn lint`, and `yarn build` foundation;
|
|
47
|
-
3. the selected primary runner across all
|
|
47
|
+
3. the selected primary runner across all 239 live-routing cases, followed by the optional distinct portability runner across the exact 49-case read-only sample when requested;
|
|
48
48
|
4. fixture preparation and the selected primary runner for every writable case, including the controller-owned AST/behavior oracles and target typecheck;
|
|
49
49
|
5. `yarn generate`, `yarn typecheck`, `yarn lint`, and `yarn build` in every writable target, after its trusted oracles;
|
|
50
50
|
6. real generated-code execution for OMH-163 and OMH-192 through fixed Jest, OMH-164 through API-only Playwright, and OMH-165 through real-browser Playwright; and
|
|
@@ -520,7 +520,7 @@
|
|
|
520
520
|
],
|
|
521
521
|
"maxContextFiles": 8,
|
|
522
522
|
"maxInitialContextBytes": 65536,
|
|
523
|
-
"maxTotalContextBytes":
|
|
523
|
+
"maxTotalContextBytes": 114688,
|
|
524
524
|
"relatedCases": [
|
|
525
525
|
"OMH-008"
|
|
526
526
|
]
|
|
@@ -1736,7 +1736,7 @@
|
|
|
1736
1736
|
],
|
|
1737
1737
|
"maxContextFiles": 6,
|
|
1738
1738
|
"maxInitialContextBytes": 65536,
|
|
1739
|
-
"maxTotalContextBytes":
|
|
1739
|
+
"maxTotalContextBytes": 102400,
|
|
1740
1740
|
"relatedCases": [
|
|
1741
1741
|
"OMH-023"
|
|
1742
1742
|
]
|
|
@@ -2431,7 +2431,7 @@
|
|
|
2431
2431
|
],
|
|
2432
2432
|
"maxContextFiles": 6,
|
|
2433
2433
|
"maxInitialContextBytes": 49152,
|
|
2434
|
-
"maxTotalContextBytes":
|
|
2434
|
+
"maxTotalContextBytes": 114688,
|
|
2435
2435
|
"relatedCases": [
|
|
2436
2436
|
"OMH-031"
|
|
2437
2437
|
]
|
|
@@ -4553,7 +4553,7 @@
|
|
|
4553
4553
|
],
|
|
4554
4554
|
"maxContextFiles": 5,
|
|
4555
4555
|
"maxInitialContextBytes": 40960,
|
|
4556
|
-
"maxTotalContextBytes":
|
|
4556
|
+
"maxTotalContextBytes": 106496,
|
|
4557
4557
|
"relatedCases": [
|
|
4558
4558
|
"OMH-058"
|
|
4559
4559
|
],
|
|
@@ -5144,7 +5144,7 @@
|
|
|
5144
5144
|
],
|
|
5145
5145
|
"maxContextFiles": 8,
|
|
5146
5146
|
"maxInitialContextBytes": 65536,
|
|
5147
|
-
"maxTotalContextBytes":
|
|
5147
|
+
"maxTotalContextBytes": 114688,
|
|
5148
5148
|
"relatedCases": [
|
|
5149
5149
|
"OMH-065"
|
|
5150
5150
|
]
|
|
@@ -21687,5 +21687,79 @@
|
|
|
21687
21687
|
".ai/guides/customers-calendar.md"
|
|
21688
21688
|
]
|
|
21689
21689
|
}
|
|
21690
|
+
},
|
|
21691
|
+
{
|
|
21692
|
+
"id": "OMH-239",
|
|
21693
|
+
"title": "Create or publish one custom module and continue development in the same standalone app",
|
|
21694
|
+
"family": "architecture",
|
|
21695
|
+
"mode": "analysis",
|
|
21696
|
+
"evaluationKind": "routing",
|
|
21697
|
+
"risk": "medium",
|
|
21698
|
+
"prompt": "I am already inside a create-mercato-app Cloud sandbox. Explain the supported npx tool commands to start a new visits module, or package an existing visits module, then publish it to npm and a dedicated GitHub repository. Include a local preview before remote publication and explain how to keep developing in this same app after publication, including the optional repository link and its portability. Distinguish npm login, environment token and trusted publishing requirements. Prepare the workflow only; do not publish or create remote resources.",
|
|
21699
|
+
"tags": [
|
|
21700
|
+
"architecture",
|
|
21701
|
+
"module-package",
|
|
21702
|
+
"publication",
|
|
21703
|
+
"source-link",
|
|
21704
|
+
"auth"
|
|
21705
|
+
],
|
|
21706
|
+
"owner": {
|
|
21707
|
+
"kind": "guide",
|
|
21708
|
+
"path": ".ai/guides/module-tool.md",
|
|
21709
|
+
"ruleIds": [
|
|
21710
|
+
"BC-01",
|
|
21711
|
+
"BC-04"
|
|
21712
|
+
]
|
|
21713
|
+
},
|
|
21714
|
+
"expectedRouter": {
|
|
21715
|
+
"required": [
|
|
21716
|
+
"architecture"
|
|
21717
|
+
],
|
|
21718
|
+
"allowedExtra": []
|
|
21719
|
+
},
|
|
21720
|
+
"requiredSkills": [],
|
|
21721
|
+
"context": {
|
|
21722
|
+
"required": [
|
|
21723
|
+
"AGENTS.md",
|
|
21724
|
+
".ai/guides/module-tool.md"
|
|
21725
|
+
],
|
|
21726
|
+
"allowedExtra": [
|
|
21727
|
+
".ai/guides/architecture.md"
|
|
21728
|
+
],
|
|
21729
|
+
"forbidden": [
|
|
21730
|
+
".env*",
|
|
21731
|
+
".git/**",
|
|
21732
|
+
"node_modules/**"
|
|
21733
|
+
]
|
|
21734
|
+
},
|
|
21735
|
+
"requiredDecisions": [
|
|
21736
|
+
"module-tool-init-or-existing",
|
|
21737
|
+
"dry-run-before-publication",
|
|
21738
|
+
"fresh-consumer-third-party",
|
|
21739
|
+
"app-source-preserved",
|
|
21740
|
+
"optional-repository-source-link",
|
|
21741
|
+
"npm-auth-mode-boundaries"
|
|
21742
|
+
],
|
|
21743
|
+
"forbiddenPatterns": [
|
|
21744
|
+
"(?:print|display|commit).{0,30}(?:NPM_TOKEN|NODE_AUTH_TOKEN|raw token)",
|
|
21745
|
+
"(?:edit|patch).{0,30}(?:node_modules|generated registr)"
|
|
21746
|
+
],
|
|
21747
|
+
"validators": [
|
|
21748
|
+
"catalog.schema",
|
|
21749
|
+
"owner.reference",
|
|
21750
|
+
"skills.reference",
|
|
21751
|
+
"router.contract",
|
|
21752
|
+
"context.budget",
|
|
21753
|
+
"context.forbidden",
|
|
21754
|
+
"patterns.forbidden"
|
|
21755
|
+
],
|
|
21756
|
+
"maxContextFiles": 3,
|
|
21757
|
+
"maxInitialContextBytes": 32768,
|
|
21758
|
+
"maxTotalContextBytes": 32768,
|
|
21759
|
+
"relatedCases": [
|
|
21760
|
+
"OMH-002",
|
|
21761
|
+
"OMH-046",
|
|
21762
|
+
"OMH-161"
|
|
21763
|
+
]
|
|
21690
21764
|
}
|
|
21691
21765
|
]
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"$id": "https://open-mercato.dev/schemas/standalone-harness-cases.schema.json",
|
|
4
4
|
"title": "Open Mercato standalone harness case catalog",
|
|
5
5
|
"type": "array",
|
|
6
|
-
"minItems":
|
|
7
|
-
"maxItems":
|
|
6
|
+
"minItems": 239,
|
|
7
|
+
"maxItems": 239,
|
|
8
8
|
"items": {
|
|
9
9
|
"type": "object",
|
|
10
10
|
"additionalProperties": false,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"maxTotalContextBytes", "relatedCases"
|
|
16
16
|
],
|
|
17
17
|
"properties": {
|
|
18
|
-
"id": { "type": "string", "pattern": "^OMH-(00[1-9]|0[1-9][0-9]|1[0-9][0-9]|20[0-9]|21[0-9]|22[0-9]|23[0-
|
|
18
|
+
"id": { "type": "string", "pattern": "^OMH-(00[1-9]|0[1-9][0-9]|1[0-9][0-9]|20[0-9]|21[0-9]|22[0-9]|23[0-9])$" },
|
|
19
19
|
"title": { "type": "string", "minLength": 12, "maxLength": 180 },
|
|
20
20
|
"family": { "enum": ["architecture", "module", "umes", "integration", "ai-workflow", "bugfix", "business", "testing"] },
|
|
21
21
|
"mode": { "enum": ["analysis", "one-shot", "spec", "bugfix", "review"] },
|
|
@@ -168,7 +168,7 @@
|
|
|
168
168
|
"maxInitialContextBytes": { "type": "integer", "minimum": 4096, "maximum": 98304 },
|
|
169
169
|
"maxTotalContextBytes": { "type": "integer", "minimum": 8192, "maximum": 1048576 },
|
|
170
170
|
"timeoutMs": { "type": "integer", "minimum": 1000, "maximum": 600000 },
|
|
171
|
-
"relatedCases": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "pattern": "^OMH-(00[1-9]|0[1-9][0-9]|1[0-9][0-9]|20[0-9]|21[0-9]|22[0-9]|23[0-
|
|
171
|
+
"relatedCases": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "type": "string", "pattern": "^OMH-(00[1-9]|0[1-9][0-9]|1[0-9][0-9]|20[0-9]|21[0-9]|22[0-9]|23[0-9])$" } },
|
|
172
172
|
"source": {
|
|
173
173
|
"type": "object",
|
|
174
174
|
"additionalProperties": false,
|
|
@@ -12,6 +12,8 @@ Create the smallest working vertical slice under `src/modules/<id>/`. START at [
|
|
|
12
12
|
- A domain brief; infer names conservatively and ask only when a choice changes public behavior or scope.
|
|
13
13
|
- Optional requested phases. Without phases, deliver the complete slice needed by the brief.
|
|
14
14
|
|
|
15
|
+
With terminal access, initialize a new app module with `npx create-mercato-module init <module_id>` before implementing the slice; skip `init` for existing modules. Without process execution, report that capability gap instead of claiming initialization or bypassing the tool. For publication or continued development in a dedicated repository, follow `.ai/guides/module-tool.md`.
|
|
16
|
+
|
|
15
17
|
## Workflow
|
|
16
18
|
|
|
17
19
|
Route before reading: every specialist step below is conditional. Decide from the brief and the blueprint route key first, include each applicable route in the assembled route, and only then read that route's guide or skill. Never probe a specialist guide and discard its route. In particular, do not open the extension or framework-context skill as a precaution: select UMES only for an injected, overridden, enriched, or intercepted installed surface, and select framework context only after naming an unresolved exact-version detail. For an architecture-only plan, the root router's `architecture` + `module-data` exception wins: use the blueprint to name likely UI/workflow surfaces without loading their implementation guides or skills.
|
|
@@ -2906,13 +2906,79 @@ function buildRunnerInvocation({ runner, root, schemaPath, outputPath, model, re
|
|
|
2906
2906
|
return { command: 'claude', args }
|
|
2907
2907
|
}
|
|
2908
2908
|
|
|
2909
|
-
function
|
|
2909
|
+
export function codexOutputSchema(schema) {
|
|
2910
|
+
if (!isPlainObject(schema)) return schema
|
|
2911
|
+
const strict = { ...schema }
|
|
2912
|
+
delete strict.uniqueItems
|
|
2913
|
+
if (schema.$defs) strict.$defs = Object.fromEntries(Object.entries(schema.$defs).map(([key, child]) => [key, codexOutputSchema(child)]))
|
|
2914
|
+
if (schema.items) strict.items = codexOutputSchema(schema.items)
|
|
2915
|
+
for (const keyword of ['anyOf', 'oneOf', 'allOf']) {
|
|
2916
|
+
if (Array.isArray(schema[keyword])) strict[keyword] = schema[keyword].map(codexOutputSchema)
|
|
2917
|
+
}
|
|
2918
|
+
if (schema.properties) {
|
|
2919
|
+
const required = new Set(schema.required ?? [])
|
|
2920
|
+
strict.properties = Object.fromEntries(Object.entries(schema.properties).map(([key, child]) => {
|
|
2921
|
+
const converted = codexOutputSchema(child)
|
|
2922
|
+
return [key, required.has(key) ? converted : { anyOf: [converted, { type: 'null' }] }]
|
|
2923
|
+
}))
|
|
2924
|
+
strict.required = Object.keys(schema.properties)
|
|
2925
|
+
}
|
|
2926
|
+
return strict
|
|
2927
|
+
}
|
|
2928
|
+
|
|
2929
|
+
function acceptsCanonicalNull(schema, rootSchema) {
|
|
2930
|
+
if (schema.$ref) {
|
|
2931
|
+
const resolved = resolveJsonSchemaReference(rootSchema, schema.$ref)
|
|
2932
|
+
return resolved ? acceptsCanonicalNull(resolved, rootSchema) : false
|
|
2933
|
+
}
|
|
2934
|
+
if (schema.anyOf && !schema.anyOf.some((child) => acceptsCanonicalNull(child, rootSchema))) return false
|
|
2935
|
+
if (schema.oneOf && schema.oneOf.filter((child) => acceptsCanonicalNull(child, rootSchema)).length !== 1) return false
|
|
2936
|
+
return validateJsonSchema(null, schema, '$', rootSchema).length === 0
|
|
2937
|
+
}
|
|
2938
|
+
|
|
2939
|
+
export function normalizeCodexOutput(value, schema, rootSchema = schema) {
|
|
2940
|
+
if (schema.$ref) {
|
|
2941
|
+
const resolved = resolveJsonSchemaReference(rootSchema, schema.$ref)
|
|
2942
|
+
return resolved ? normalizeCodexOutput(value, resolved, rootSchema) : value
|
|
2943
|
+
}
|
|
2944
|
+
if (Array.isArray(value) && schema.items) return value.map((item) => normalizeCodexOutput(item, schema.items, rootSchema))
|
|
2945
|
+
if (!isPlainObject(value) || !schema.properties) return value
|
|
2946
|
+
const normalized = { ...value }
|
|
2947
|
+
const required = new Set(schema.required ?? [])
|
|
2948
|
+
for (const [key, child] of Object.entries(schema.properties)) {
|
|
2949
|
+
if (!Object.hasOwn(value, key)) continue
|
|
2950
|
+
const nullable = acceptsCanonicalNull(child, rootSchema)
|
|
2951
|
+
if (value[key] === null && !required.has(key) && !nullable) delete normalized[key]
|
|
2952
|
+
else normalized[key] = normalizeCodexOutput(value[key], child, rootSchema)
|
|
2953
|
+
}
|
|
2954
|
+
return normalized
|
|
2955
|
+
}
|
|
2956
|
+
|
|
2957
|
+
export function codexOutputPrompt(prompt, schema) {
|
|
2958
|
+
const optionalFields = Object.keys(schema.properties ?? {}).filter((key) => !(schema.required ?? []).includes(key))
|
|
2959
|
+
if (!optionalFields.length) return prompt
|
|
2960
|
+
return `${prompt}\n\nCodex wire format: nullable fields encode optional output. Use null for fields that the instructions omit or do not request; never invent optional content merely because the wire schema requires its key.`
|
|
2961
|
+
}
|
|
2962
|
+
|
|
2963
|
+
export function routingResponseSchemaForCase(schema, caseRecord) {
|
|
2964
|
+
if (isSpecRoutingCase(caseRecord) || !schema.properties?.specRouting) return schema
|
|
2965
|
+
const properties = { ...schema.properties }
|
|
2966
|
+
delete properties.specRouting
|
|
2967
|
+
return {
|
|
2968
|
+
...schema,
|
|
2969
|
+
properties,
|
|
2970
|
+
required: (schema.required ?? []).filter((key) => key !== 'specRouting'),
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
|
|
2974
|
+
function runAgentOnce({ runner, root, schemaPath, responseSchema, prompt, timeout, model, reasoningEffort, writable, allowedReads = [], allowedWrites = [], immutableRoots = [], validateResponse = validateRoutingResponse }) {
|
|
2910
2975
|
const canonicalRoot = fs.realpathSync(root)
|
|
2911
2976
|
const tempDir = fs.mkdtempSync(path.join(os.tmpdir(), 'om-harness-result-'))
|
|
2912
2977
|
const outputPath = path.join(tempDir, 'structured.json')
|
|
2913
2978
|
const isolatedSchemaPath = path.join(tempDir, 'output.schema.json')
|
|
2914
|
-
|
|
2915
|
-
|
|
2979
|
+
const canonicalSchema = responseSchema ?? readJson(schemaPath)
|
|
2980
|
+
const transportSchema = runner === 'codex' ? codexOutputSchema(canonicalSchema) : canonicalSchema
|
|
2981
|
+
fs.writeFileSync(isolatedSchemaPath, `${JSON.stringify(transportSchema)}\n`, { flag: 'wx', mode: 0o600 })
|
|
2916
2982
|
const invocation = buildRunnerInvocation({ runner, root: canonicalRoot, schemaPath: isolatedSchemaPath, outputPath, model, reasoningEffort, writable, allowedReads, allowedWrites, immutableRoots })
|
|
2917
2983
|
const runnerEnv = narrowRunnerEnv(runner)
|
|
2918
2984
|
if (runner === 'codex') {
|
|
@@ -2966,7 +3032,7 @@ function runAgentOnce({ runner, root, schemaPath, prompt, timeout, model, reason
|
|
|
2966
3032
|
})
|
|
2967
3033
|
const processResult = spawnSync(contained.command, contained.args, {
|
|
2968
3034
|
cwd: contained.cwd,
|
|
2969
|
-
input: prompt,
|
|
3035
|
+
input: runner === 'codex' ? codexOutputPrompt(prompt, canonicalSchema) : prompt,
|
|
2970
3036
|
encoding: 'utf8',
|
|
2971
3037
|
timeout,
|
|
2972
3038
|
maxBuffer: 8 * 1024 * 1024,
|
|
@@ -2979,8 +3045,9 @@ function runAgentOnce({ runner, root, schemaPath, prompt, timeout, model, reason
|
|
|
2979
3045
|
if (processResult.error) return { kind: 'environment-failure', durationMs, exitStatus: processResult.status, error: processResult.error.message, stdout: processResult.stdout ?? '' }
|
|
2980
3046
|
if (processResult.status !== 0) return { kind: 'process-failure', durationMs, exitStatus: processResult.status, error: processFailureDiagnostic(runner, processResult), stdout: processResult.stdout ?? '' }
|
|
2981
3047
|
try {
|
|
2982
|
-
const
|
|
2983
|
-
const
|
|
3048
|
+
const transportResponse = extractJsonCandidate(processResult.stdout ?? '', outputPath, runner)
|
|
3049
|
+
const rawResponse = runner === 'codex' ? normalizeCodexOutput(transportResponse, canonicalSchema) : transportResponse
|
|
3050
|
+
const schemaErrors = [...validateResponse(rawResponse), ...validateJsonSchema(rawResponse, canonicalSchema)]
|
|
2984
3051
|
if (schemaErrors.length) return { kind: 'invalid-structured-output', durationMs, exitStatus: processResult.status, error: schemaErrors.join('; '), stdout: processResult.stdout ?? '' }
|
|
2985
3052
|
const response = rawResponse
|
|
2986
3053
|
for (const key of ['selectedRouter', 'selectedSkills', 'selectedContext', 'decisions', 'violations']) {
|
|
@@ -3668,6 +3735,7 @@ export function resolveLiveCaseTimeout(options, model, caseTimeout = 0) {
|
|
|
3668
3735
|
|
|
3669
3736
|
function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, harnessDir, resultSchema }) {
|
|
3670
3737
|
const schemaPath = path.join(harnessDir, 'routing-response.schema.json')
|
|
3738
|
+
const routingResponseSchema = readJson(schemaPath)
|
|
3671
3739
|
const version = runnerVersion(options.runner, root)
|
|
3672
3740
|
const model = options.model ?? releaseMatrix.routing.runners[options.runner].modelSelector
|
|
3673
3741
|
const writableRoot = options.writableRoot ? path.resolve(options.writableRoot) : undefined
|
|
@@ -3710,8 +3778,9 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
|
|
|
3710
3778
|
// fail-closed tool server, so a declared example root can never be written.
|
|
3711
3779
|
const immutableRoots = immutableExampleRoots(evaluationCase)
|
|
3712
3780
|
const timeout = resolveLiveCaseTimeout(options, model, caseRecord.timeoutMs ?? 0)
|
|
3781
|
+
const responseSchema = routingResponseSchemaForCase(routingResponseSchema, evaluationCase)
|
|
3713
3782
|
const executions = [runAgentOnce({
|
|
3714
|
-
runner: options.runner, root: runRoot, schemaPath, prompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
|
|
3783
|
+
runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
|
|
3715
3784
|
allowedReads, allowedWrites: writable ? caseRecord.allowedWrites ?? [] : [], immutableRoots,
|
|
3716
3785
|
})]
|
|
3717
3786
|
let execution = executions[0]
|
|
@@ -3723,7 +3792,7 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
|
|
|
3723
3792
|
? `${prompt}\n\nYour previous response was not valid structured output. Return only the schema object.`
|
|
3724
3793
|
: `${prompt}\n\nThis is retry attempt 2 after a transient provider failure. Continue with the same routing contract.`
|
|
3725
3794
|
execution = runAgentOnce({
|
|
3726
|
-
runner: options.runner, root: runRoot, schemaPath, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
|
|
3795
|
+
runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
|
|
3727
3796
|
allowedReads, allowedWrites: writable ? caseRecord.allowedWrites ?? [] : [], immutableRoots,
|
|
3728
3797
|
})
|
|
3729
3798
|
executions.push(execution)
|
|
@@ -3787,7 +3856,7 @@ function liveRun({ options, selected, registry, releaseMatrix, fixtures, root, h
|
|
|
3787
3856
|
const diagnostics = routingCorrectionDiagnostics(evaluated.violations)
|
|
3788
3857
|
const retryPrompt = `${prompt}\n\nThis is correction attempt ${executions.length + 1} after the previous routing answer failed a non-safety contract. Correction kind: ${correctionKind}. Evaluator diagnostics: ${JSON.stringify(diagnostics)}. These diagnostics identify only the failing contract categories; derive every answer from emitted instructions. Start the routing audit again by calling harness.read with {"path":"AGENTS.md"}; never call read_mcp_resource or any resource API. Re-evaluate every additive Axis 1 route, Axis 2 work-unit skill, module fact, and required decision while opening only the smallest task-matching initial context. Build selectedContext from every successful read in this correction attempt: add every opened routed guide's route and every opened skill's ID, or avoid opening it. Never reuse or prune the previous answer. Re-check the context budget, then return only the schema object.`
|
|
3789
3858
|
execution = runAgentOnce({
|
|
3790
|
-
runner: options.runner, root: runRoot, schemaPath, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
|
|
3859
|
+
runner: options.runner, root: runRoot, schemaPath, responseSchema, prompt: retryPrompt, timeout, model, reasoningEffort: options.reasoningEffort, writable,
|
|
3791
3860
|
allowedReads, allowedWrites: [], immutableRoots,
|
|
3792
3861
|
})
|
|
3793
3862
|
executions.push(execution)
|
|
@@ -69,16 +69,17 @@ export function collapseReadOnlyRoots(values) {
|
|
|
69
69
|
|
|
70
70
|
export function linuxMergedUsrSymlinkArgs() {
|
|
71
71
|
const aliases = [
|
|
72
|
-
['/bin', 'usr/bin'],
|
|
73
|
-
['/sbin', 'usr/sbin'],
|
|
74
|
-
['/lib', 'usr/lib'],
|
|
75
|
-
['/lib64', 'usr/lib64'],
|
|
72
|
+
['/bin', ['usr/bin']],
|
|
73
|
+
['/sbin', ['usr/sbin', 'usr/bin']],
|
|
74
|
+
['/lib', ['usr/lib']],
|
|
75
|
+
['/lib64', ['usr/lib64', 'usr/lib']],
|
|
76
76
|
]
|
|
77
|
-
return aliases.flatMap(([alias,
|
|
77
|
+
return aliases.flatMap(([alias, targets]) => {
|
|
78
78
|
try {
|
|
79
79
|
const stat = fs.lstatSync(alias)
|
|
80
|
-
|
|
81
|
-
|
|
80
|
+
const target = stat.isSymbolicLink() ? fs.readlinkSync(alias) : null
|
|
81
|
+
return targets.includes(target)
|
|
82
|
+
? ['--symlink', target, alias]
|
|
82
83
|
: []
|
|
83
84
|
} catch { return [] }
|
|
84
85
|
})
|
|
@@ -91,6 +91,8 @@ For the complete current convention-file catalog, load `om-module-scaffold` →
|
|
|
91
91
|
|
|
92
92
|
The app root governs writable locations and safety. The compatibility snapshot governs stable public identifiers. The nearest installed package/module guide governs version-specific implementation details.
|
|
93
93
|
|
|
94
|
+
For creation, publication, and continued repository development of one app module, read `.ai/guides/module-tool.md`.
|
|
95
|
+
|
|
94
96
|
## Package and Bootstrap Boundaries
|
|
95
97
|
|
|
96
98
|
- Import public package exports; do not reach through monorepo-only relative paths or app-generated registries from a package.
|