fix(apm-orchestrate): description/delegation FAILs and confirmed add-package mapping bug #120
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Pre-existing, out-of-scope defects in
plugins/kyberforge/.apm/agents/apm-orchestrate.agent.md, surfaced by an independent post-closure audit of #99 (agent-audit + skill-audit re-run against every skill/agent changed onrefactor/adr0020-skill-retrofit). All predate that branch (the file was authored in5e23250, before #99 started) and are explicitly out of ADR-0020's skill-scoped gate, per #99's closing comment — filed separately rather than folded into #99, following the same pattern as #107-#119.Findings
1.
agent-auditdeterministic gate: FAIL (3 fails, 2 suggestions).apm.yml'stype:field constrains what.apm/may contain — settype:before any primitive content is added") restatesapm-workflow/references/configure.md's Gotcha verbatim, with no citation and no orchestrator-side enforceable action — unlike the file's other four Hard Rules, which do cite their source skill.2. Confirmed add-package mapping bug. The Inputs table (line ~41) describes the
add-packageoperation as mapping to "apm marketplace package add— register a local package into a marketplace being built." Butapm-workflow/references/marketplace.md's own Gotcha statesapm marketplace package addonly accepts remote references (owner/repo, a host URL, or a full URL) — it cannot register a local path. Registering a local package requires hand-editingmarketplace.packages[]directly. This directly contradicts the file's own Hard Rule two lines above the Inputs table, which correctly cites this exact constraint. An agent following the Inputs table's mapping for a local-package request will dispatch the wrong operation.Suggested fix
apm-workflow/references/configure.mdfrom the Hard Rule, or replace it with a boundary/delegation note per ADR-0020's agent delegation-check rule (an agent body restating a skill's owned procedure is a FAIL; the fix is "invoke<skill>instead").add-packagemapping to reflect that it only works for remote package references, and route a local-package request to the hand-edit path (or toapm-workflow'sedit-configoperation) instead.Related: #99 (closing comment), #107-#119 (other retrofit-adjacent gate/content defects filed the same way).
All three findings fixed on
refactor/adr0020-skill-retrofit(not yet pushed — the PR body will carry the close)1. Description: 386 → 224 characters
Rewritten to trigger + one capability + boundary, per ADR-0020 shape:
The catalogue opener is gone, the composition/implementation detail ("coordinated across the apm-workflow skill with safety gates, session context, and structured results") is gone, and the boundary target
apm-installresolves.scripts/skill-size-check.shonmainreported a description SUGGESTION and a missing boundary clause; on the branch both are silent.2. Delegation FAIL: the
type:Hard RuleReplaced with a one-clause orchestrator-side refusal:
That is an action this orchestrator can take, not a restatement of a rule it does not own.
Worth recording, since it is not in the report: the copy was not merely uncited, it had drifted. It asserted that
type:"constrains what.apm/may contain", which is false —type:selects processing (instructions/skill/prompts/hybrid, perPackageContentType) and validates nothing against the primitives on disk. The agent's copy also dropped the four-value enumeration the skill-side gotcha carried. The skill-side text was corrected on this branch in164948a("type: selects processing, it does not validate content"), so the agent copy was restating a rule that was itself wrong.3.
add-packagemapping bugThe Inputs row now reads:
and
edit-config's own scope was widened to admit the case it now receives: "...or adding/removing amarketplace.packages[]entry, including the local-package registrationapm marketplace package addcannot perform". Previouslyedit-configonly mentioned removing an entry, so routing there would have been routing into a scope that did not cover the request.Two further defects fixed beyond the report
When invoked, you:list at line 28 and an 8-step## Processat line 50 described the same dispatch with different wording — including two different accounts of the parallel-fan-out rule. TheWhen invokedcopy is deleted;## Processis the single sequence. Body went 1080 → 876 words on the same counter. (Agents take no body-word gate by design, peragent-audit/scripts/validate.sh— noting the figures, not claiming a gate finding.)## Processstep 2 named the deleted rule's old semantics. It listed "type:ordering" among the Hard rules to check, which was the scaffolding-order rule that no longer exists. Now reads "type:delegation".bash scripts/check-apm-agents-valid.shpasses over all four plugin-scope agent files.Fixed by #129, squash-merged to
mainas598a7c3.Description rewritten to ADR-0020 shape — trigger + one capability + boundary, with the catalogue opener and the composition/implementation detail gone:
Clears the description FAIL, is inside the 250 target, and now carries the boundary clause it lacked.
The
add-packagemapping bug is corrected at the Inputs table, which now states the constraint rather than contradicting the Hard Rule two lines above it:apm marketplace package addregisters a remote reference (owner/repo, host URL, or full URL), rejects a local path, and a local package routes toedit-configinstead. A Hard Rule was also added telling the caller never to guess the marketplace-add direction from context but to resolve it strictly from the operation name, citingapm-workflow/references/marketplace.md.The delegation FAIL — the uncited Hard Rule restating
configure.md's Gotcha verbatim — is resolved the same way the file's other four rules were: it now cites its source skill.Stayed open after the merge because Gitea's closing-keyword parser consumed only the first reference in
Closes #99, #107, …. Closing manually.