Skip to content

dimagi-internal/ace / skills/supply-chain-setup-qa

supply-chain-setup-qa

Verified

Pass/fail check, against a fresh labs read, that a programme's supply-chain setup landed. Static, no LLM.

Supply-chain setup QA

Structural checks on what supply-chain-setup wrote, judged against what labs holds now, never against the write responses. A write can answer ok and still not leave the record the next skill needs; procurement on a half-built registry fails later and harder.

See skills/_qa-template.md for the shared QA contract.

Inputs

ParameterUsed forResolver
program_idthe labs programme to readexplicit arg; default: run_state phases.execution-management.products.supply_chain.program_id
planwhat setup meant to createexplicit arg (a file id or path); default: 9-execution-manager/supply-chain-setup_manifest.yaml in the run folder
ace_emailace@'s sign-in, for the team checkconfig/agent.json email

Products

  • 9-execution-manager/supply-chain-setup-qa_result.yaml: the result, built with aggregateQAResult (lib/qa-types.ts). Outside a run, the same file next to the plan.

Checks

The functions live in skills/supply-chain-setup-qa/checks.ts. Each takes one JSON document, {plan, readback}, and the shapes are declared there (SetupPlan, SetupReadback).

#idtypedescriptionauto-fix on fail
1runner_standing_programmestaticACE's standing is programme (or operator)re-run setup Step 1; resolve any [BLOCKER]
2runner_matches_planstaticthe runner labs reports is the one the plan recordedrecord the real runner; never move it
3orgs_boundstaticthe pm and llo labs orgs are bound to their Connect org idsre-upsert with connect_organization_id
4planned_records_read_backstaticevery planned commodity, item, supply point and supplier is in labsre-run the step (refs replay)
5user_held_points_namedstaticone user_held point per field worker, each naming that usernameupsert the missing points
6suppliers_syntheticstaticevery invented supplier carries [Synthetic]rename via syntheticName()
7team_has_ace_adminstaticace@ is an admin of the running org's teamprogramme_team_add as admin
8no_registry_conflictsstaticchecks_list shows no conflictcorrect the record it names

missing findings in checks_list are expected at setup (nothing has been quoted or counted yet) and do not fail check 8.

Process

  1. Read labs fresh, all with program_id: supply_chain_programme_runner_get, supply_chain_org_list, supply_chain_commodity_list, supply_chain_item_list, supply_chain_supply_point_list({include_inactive: true}), supply_chain_supplier_list, supply_chain_programme_team_list, supply_chain_checks_list.
  2. Normalise the replies with normalizeReadback (checks.ts), passing each reply as labs returned it. If programme_team_list refused, pass {error: <the refusal text>}: on a Dimagi-run programme it always refuses (Dimagi's team is everyone with a Dimagi address), and the normaliser turns that into team_by_domain. Read the plan into SetupPlan.
  3. Run CHECKS over JSON.stringify({plan, readback}) and write the result with aggregateQAResult.
  4. On fail, return the failures with their hints to the caller. Re-running setup is safe: its source refs are deterministic, so records that landed are replayed, not duplicated.

MCP Tools Used

  • connect-labs: supply_chain_programme_runner_get, supply_chain_org_list, supply_chain_commodity_list, supply_chain_item_list, supply_chain_supply_point_list, supply_chain_supplier_list, supply_chain_programme_team_list, supply_chain_checks_list
  • ace-gdrive: drive_read_file (plan), drive_create_file (result)

Change Log

DateChangeAuthor
2026-10-18Initial version (optional-track PR6): 8 static checks over a fresh labs readACE
finishing-a-development-branchobra/superpowersUse when implementation is complete, all tests pass, and you need to decide how to integrate the workStars: 319kUpdated Claude CodeCodexVerifiedInstall
systematic-debuggingobra/superpowersUse when encountering any bug, test failure, or unexpected behavior, before proposing fixesStars: 319kUpdated Claude CodeCodexVerifiedInstall
test-driven-developmentobra/superpowersUse when implementing any feature or bugfix, before writing implementation codeStars: 319kUpdated Claude CodeCodexVerifiedInstall
skill-creatoranthropics/skillsCreate new skills, modify and improve existing skills, and measure skill performance. Use when users want to create a skill from scratch, edit, or optimize an existing skill, run evals to test a skill, benchmark skill performance with variance analysis, or optimize a skill's description for better triggering accuracy.Stars: 196kUpdated Claude CodeCodexVerifiedInstall