fix(kyberforge): apply the #273 review to the apm 0.39.3 refresh
- apm-workflow and apm-orchestrate always pass --project to uv run, because uv run outside the project silently runs the PATH apm. The agent now checks that the reported version equals the pin, or is 0.39.2 or later where nothing pins it, not only that it exits 0. - A pin is a quoted apm-cli or apm_cli requirement plus a uv.lock, matching the SessionStart hook, in apm-install, uv-pin.md and apm-workflow. - uv-pin.md spells the hook's exact invocation and its environment check, and says scripts always pass --project. - instructions-author and its research note: a Claude rule leaves .claude/rules/ only when compile actually wrote it into AGENTS.md; install-then-compile dedups it. - prompt-author: Kiro strips every key with a warning, not silently. - Record the 0.39.3 executables findings in approvals-and-executables.md and the output-profile and type-routing facts in cli-reference.md, and cite those digests. - forge's routing table notes that Kiro gets the body only. Refs: #273 Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_014uGZTNugst7K9Bd2FTR4Mi
This commit is contained in:
1 parent
c68b67301a
commit
e6d680a4c5
14 files changed
+49
-26
No files matched your search
@@ -13,7 +13,7 @@ You are the orchestrator for apm package/marketplace operations. Your one job is
|
||||
|
||||
You resolve the package root once per dispatched operation (the directory containing that package's `apm.yml`) and carry it forward as session context rather than making every call re-resolve it.
|
||||
|
||||
**Scope:** this orchestrator routes `apm-workflow`'s five concerns only — configure/scaffold, marketplace, install, compile/pack/publish, audit. It does not route `apm-install` (binary install, agent-runtime setup) — that's a one-time machine bootstrap, not a per-package, fan-out-able operation, and has no orchestrator counterpart. Confirm the repo's apm answers `--version` before dispatching any operation: `uv run --frozen apm --version` in a repo that pins apm with uv, `apm --version` otherwise (`apm-workflow` Step 2 says how to tell). If it fails, tell the caller to run `apm-install` first rather than attempting recovery here.
|
||||
**Scope:** this orchestrator routes `apm-workflow`'s five concerns only — configure/scaffold, marketplace, install, compile/pack/publish, audit. It does not route `apm-install` (binary install, agent-runtime setup) — that's a one-time machine bootstrap, not a per-package, fan-out-able operation, and has no orchestrator counterpart. Confirm the repo's apm reports a usable version before dispatching any operation: `uv run --project <repo root> --frozen apm --version` in a repo that pins apm with uv, `apm --version` otherwise (`apm-workflow` Step 2 says how to tell). Always pass `--project`: `uv run` outside the project silently falls back to the `PATH` apm. Exit 0 is not enough. The version must equal the repo's pin, or be 0.39.2 or later where nothing pins it, because an older apm refuses a v4 lockfile. If the check fails, tell the caller to run `apm-install` first rather than attempting recovery here.
|
||||
|
||||
## Hard rules
|
||||
|
||||
@@ -43,7 +43,7 @@ These are non-negotiable regardless of `confirm` or any skill-local override:
|
||||
1. Validate the request structure and check if `operation` is known
|
||||
2. Check the request against the Hard rules above (publish confirmation, marketplace-add direction, `type:` delegation, audit-vs-audit-ci, registries precondition) — refuse outright on violation, independent of `confirm`
|
||||
3. If `operation` is `publish`: require `confirm: true`, dispatch `--dry-run -v` first regardless, surface that output, else fail with structured "requires explicit confirmation" error
|
||||
4. Verify the repo's apm answers `--version` (pinned: `uv run --frozen apm --version`); if not, fail with a diagnostic pointing to `apm-install`
|
||||
4. Verify the repo's apm version (pinned: `uv run --project <repo root> --frozen apm --version`, which must equal the pin; otherwise `apm --version`, which must be 0.39.2 or later); if not, fail with a diagnostic pointing to `apm-install`
|
||||
5. Invoke `apm-workflow` via `Skill` with the resolved action, `package_root`, and parameters
|
||||
6. If fanning across multiple packages, dispatch independent packages in parallel when no shared state or ordering dependency exists between them; loop package-by-package (strictly sequential) only for packages with a real dependency on another package's completion. Either way, collect per-package results and failures rather than aborting on the first failure
|
||||
7. Catch and handle apm errors: retry once for a dependency-not-yet-scaffolded failure after the caller confirms the dependency exists; otherwise return error structure with diagnostics. If the failure looks trivially fixable by a one-line manifest edit — a missing `category:`, a typo'd `source:`, a version that disagrees between a package and the catalog — name that fix in `suggestions` and stop. Do not apply it yourself and do not self-dispatch an `edit-config` to apply it
|
||||
|
||||
Reference in new issue
Block a user