@deeeed/metamask-harness 0.61.1 → 0.63.0
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/CHANGELOG.md +25 -0
- package/README.md +7 -0
- package/adapters/mobile/open-device.sh +63 -35
- package/dist/advisor-policy.js +40 -0
- package/dist/assessment-providers.js +12 -0
- package/dist/cli-commands.js +2 -2
- package/dist/command-contract.js +11 -3
- package/dist/commands/config.js +14 -9
- package/dist/commands/prepare.js +30 -2
- package/dist/commands/recipe-advice.js +76 -0
- package/dist/commands/recipe-quality.js +8 -1
- package/dist/commands/run-engine.js +1 -0
- package/dist/commands/status-watch.js +43 -7
- package/dist/commands/status.js +8 -1
- package/dist/devices.js +4 -2
- package/dist/mm-harness-cli.js +42 -8
- package/dist/paths.js +2 -0
- package/dist/recipe-assistance-context.js +149 -0
- package/dist/recipe-assistance-rubric.js +46 -0
- package/dist/recipe-assistance.js +68 -0
- package/dist/review/knowledge.js +13 -0
- package/dist/semantic-assessment.js +0 -0
- package/dist/task-view.js +45 -2
- package/dist/typesafe-client.js +57 -0
- package/docs/QA.md +2 -1
- package/docs/RECIPES.md +79 -0
- package/docs/SECURITY.md +8 -0
- package/package.json +1 -1
- package/scripts/completions.sh +3 -0
package/docs/RECIPES.md
CHANGED
|
@@ -19,6 +19,85 @@ mm-harness run <name> --describe
|
|
|
19
19
|
Discovery reports parameters, selected adapter variant, nested recipes, source,
|
|
20
20
|
and shadows. Use `--json` for exact metadata.
|
|
21
21
|
|
|
22
|
+
## Optional recipe advisor
|
|
23
|
+
|
|
24
|
+
`recipe-quality plan` assesses acceptance criteria against adapter-supported
|
|
25
|
+
actions and library recipes before a draft exists. Provide a JSON task with an
|
|
26
|
+
`acceptanceCriteria` array of 1–20 non-empty strings, plus optional `title` and
|
|
27
|
+
`description`. Each result identifies a candidate to reuse or compose, or asks
|
|
28
|
+
for more discovery or manual review. A shortlist is not the complete catalog,
|
|
29
|
+
and a matching description does not establish runtime proof.
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
mm-harness recipe-quality plan --task task.json --adapter extension --advisor typesafe --output artifacts/recipe-plan.json --json
|
|
33
|
+
mm-harness recipe-quality advise --recipe artifacts/recipe.json --task TASK.md --adapter extension --advisor typesafe --output artifacts/recipe-advice.json --json
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Advice is disabled by default. Enable it for one call with `--advisor <provider>`,
|
|
37
|
+
or save an engineer preference in the existing `~/.mm-harness/config.json`:
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
mm-harness config set advisor.provider typesafe
|
|
41
|
+
mm-harness config set advisor.stages plan
|
|
42
|
+
mm-harness config set advisor.enabled true
|
|
43
|
+
mm-harness recipe-quality advisor-status --json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
TypeSafe is the first provider and reads `TYPESAFE_API_KEY` from the execution
|
|
47
|
+
host's environment. Keys never belong in the config. `advisor.model` or
|
|
48
|
+
`--advisor-model <model-or-alias>` overrides its default, currently `jev-1.13.0`.
|
|
49
|
+
Artifacts record the provider, requested model and returned version.
|
|
50
|
+
|
|
51
|
+
Precedence is CLI options, then `MM_HARNESS_ADVISOR`,
|
|
52
|
+
`MM_HARNESS_ADVISOR_MODEL`, `MM_HARNESS_ADVISOR_STAGES`, then engineer settings,
|
|
53
|
+
then disabled. The advisor override is a provider name or `off`; stages are a
|
|
54
|
+
comma-separated subset of `plan,draft,evidence`. A provider or model saved alone,
|
|
55
|
+
or an API key, never enables advice. `--advisor off` overrides an enabled profile.
|
|
56
|
+
A model override alone needs an already enabled provider.
|
|
57
|
+
|
|
58
|
+
`advisor-status` is read-only and makes no provider call. It reports resolved
|
|
59
|
+
stages, provider/model, key availability and setting sources without secrets.
|
|
60
|
+
Missing keys report `skipped`; request failures report `unavailable`. Skills
|
|
61
|
+
can record that output per task, invoke only the enabled stages, and continue
|
|
62
|
+
normally when advice is unavailable. The initial profile enables planning only.
|
|
63
|
+
Saved policy skips unselected stages with `stage_disabled`; an explicit
|
|
64
|
+
`--advisor <provider>` call can request a stage directly. Pass `--advisor-stages`
|
|
65
|
+
as well when a task must preserve its frozen stage policy.
|
|
66
|
+
|
|
67
|
+
Farmslot can use its existing execution environment forwarding, for example
|
|
68
|
+
`MM_HARNESS_ADVISOR=typesafe MM_HARNESS_ADVISOR_STAGES=plan`, or select a saved
|
|
69
|
+
profile file through `MM_HARNESS_CONFIG`. The harness executing on that worker
|
|
70
|
+
resolves the policy. Keep provider credentials in that host's secret environment,
|
|
71
|
+
not project JSON or task inputs. No Farmslot-specific resolver is needed.
|
|
72
|
+
|
|
73
|
+
`advise --recipe` requires the file path of a statically valid draft. Use `--params`
|
|
74
|
+
with a JSON object for root parameter values. Its called recipe dependencies use
|
|
75
|
+
the same library resolution as `run`, including `--library name=path` overrides.
|
|
76
|
+
Optional `--evidence file.json` reads only that explicit text artifact;
|
|
77
|
+
it does not inspect images or follow referenced files. Named credentials are
|
|
78
|
+
redacted. Whole optional candidate contracts are omitted first to fit the bound;
|
|
79
|
+
if the task, recipe, used contracts and evidence still exceed it, advice is
|
|
80
|
+
skipped without truncating those inputs. Supply focused inputs without wallet
|
|
81
|
+
secrets or unrelated logs.
|
|
82
|
+
|
|
83
|
+
These results are advisory and their confidence is uncalibrated. The author
|
|
84
|
+
decides whether to revise the recipe, then validates and executes it normally.
|
|
85
|
+
Advice is kept separate from `recipe-quality.json` and cannot change a run's
|
|
86
|
+
pass/fail status, authorize retries, or substitute for missing proof.
|
|
87
|
+
|
|
88
|
+
An authoring agent can request `plan` before drafting, inspect the proposed
|
|
89
|
+
contracts, then request `advise` on its statically valid draft. After executing
|
|
90
|
+
the recipe, it can call `advise` again with `--evidence` pointing to focused JSON
|
|
91
|
+
observations from the trace. Include the scenario parameters and observations
|
|
92
|
+
for every claimed case; a filename or successful order submission is not proof
|
|
93
|
+
of an observed position. The command reads that JSON only, not linked files.
|
|
94
|
+
|
|
95
|
+
`completed` means the provider answered, not that the recipe passed. Address
|
|
96
|
+
`attention`, discover missing information for `insufficient_context`, and inspect
|
|
97
|
+
images for `needs_visual_review`. Revalidate and rerun any revised recipe through
|
|
98
|
+
normal commands. `disabled`, `skipped`, and `unavailable` leave the authoring
|
|
99
|
+
workflow in charge. These calls are explicit; `run` never invokes an advisor itself.
|
|
100
|
+
|
|
22
101
|
## Author and run
|
|
23
102
|
|
|
24
103
|
An action performs one typed operation. A recipe owns a reusable graph or a
|
package/docs/SECURITY.md
CHANGED
|
@@ -117,3 +117,11 @@ Security-sensitive changes require:
|
|
|
117
117
|
5. independent review of the exact diff.
|
|
118
118
|
|
|
119
119
|
Use [QA](QA.md) for the runnable checklist.
|
|
120
|
+
|
|
121
|
+
## Optional model advice
|
|
122
|
+
|
|
123
|
+
`recipe-quality plan/advise --advisor typesafe` sends the declared task, relevant recipe and action contracts, effective parameters, validation findings, and explicitly supplied text evidence to `https://api.typesafe.ai/v1/systemone`. It is off by default and uses the engineer's `TYPESAFE_API_KEY`. Named credentials and known secret-input values are redacted; this is not a general guarantee that arbitrary prose is free of secrets. The provider does not receive images, and results remain separate advisory artifacts.
|
|
124
|
+
|
|
125
|
+
Provider adapters own endpoints, credential names and response validation. Shared recipe policy uses typed semantic assessments; it does not select a model. `--advisor-model` changes the selected provider's model, not its endpoint or credential destination. Only implemented providers are accepted. Artifacts identify both the requested and returned model; confidence and probabilities are optional and are not treated as calibrated across providers.
|
|
126
|
+
|
|
127
|
+
Saved advisor opt-in lives in the existing engineer config; CLI overrides take precedence over execution-environment overrides and saved preferences. `advisor-status` never sends context or returns credential values. Configuration accepts enabled/provider/model/stages only. A key alone does not opt in, and `--advisor off` disables an enabled profile. Advice input reads use one bounded file descriptor so replacing a path between checking and reading cannot switch the contents.
|
package/package.json
CHANGED
package/scripts/completions.sh
CHANGED
|
@@ -42,6 +42,7 @@ _mmh_flags_for() {
|
|
|
42
42
|
fixtures) printf '%s' "--from --dev --force --fixture --adapter --target --json" ;;
|
|
43
43
|
checklist) printf '%s' "" ;;
|
|
44
44
|
execution-template) printf '%s' "--dir --domain-dir --project-worker --project-name --package-templates --package-id --flow --run-mode --platform --domain --id --provenance --include-shadowed --no-include-shadowed --title --force --json" ;;
|
|
45
|
+
recipe-quality) printf '%s' "--input --output --recipe --task --evidence --params --adapter --library --advisor --advisor-model --advisor-stages --json" ;;
|
|
45
46
|
actions) printf '%s' "--adapter --action --kind --raw --action-manifest --target --json" ;;
|
|
46
47
|
call) printf '%s' "--list --arg --adapter --target --artifacts-dir --action-manifest --heal --json" ;;
|
|
47
48
|
run) printf '%s' "--list --describe --plan --adapter --artifacts-dir --target --library --cdp-port --heal --record-video --json" ;;
|
|
@@ -80,6 +81,7 @@ if [ -n "${BASH_VERSION:-}" ]; then
|
|
|
80
81
|
launch) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "ios android" -- "$cur")) ;;
|
|
81
82
|
fixtures) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "init sync set reset generate finalize" -- "$cur")) ;;
|
|
82
83
|
checklist) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "mark closeout" -- "$cur")) ;;
|
|
84
|
+
recipe-quality) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "build plan advise advisor-status" -- "$cur")) ;;
|
|
83
85
|
completions) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "install bash zsh status" -- "$cur")) ;;
|
|
84
86
|
call) [ "$cword" -eq 2 ] && COMPREPLY=($(compgen -W "$(_mmh_actions)" -- "$cur")) ;;
|
|
85
87
|
run) COMPREPLY=($(compgen -f -- "$cur"; compgen -W "$(_mmh_recipes)" -- "$cur")) ;;
|
|
@@ -114,6 +116,7 @@ if [ -n "${ZSH_VERSION:-}" ]; then
|
|
|
114
116
|
launch) (( CURRENT == 3 )) && { candidates=(ios android); compadd -a candidates; } ;;
|
|
115
117
|
fixtures) (( CURRENT == 3 )) && { candidates=(init sync set reset generate finalize); compadd -a candidates; } ;;
|
|
116
118
|
checklist) (( CURRENT == 3 )) && { candidates=(mark closeout); compadd -a candidates; } ;;
|
|
119
|
+
recipe-quality) (( CURRENT == 3 )) && { candidates=(build plan advise advisor-status); compadd -a candidates; } ;;
|
|
117
120
|
completions) (( CURRENT == 3 )) && { candidates=(install bash zsh status); compadd -a candidates; } ;;
|
|
118
121
|
call) (( CURRENT == 3 )) && { candidates=("${(@f)$(_mmh_actions)}"); compadd -a candidates; } ;;
|
|
119
122
|
run) candidates=("${(@f)$(_mmh_recipes)}"); compadd -a candidates; _files ;;
|