state-hub/scripts
tegwick 3dbbc753bc
All checks were successful
CI Smoke / host-smoke (push) Successful in 1s
CI Smoke / container-smoke (push) Successful in 3s
CUST-WP-0061-T03: the promotion transition (statehub promote-intake)
The mechanism named in canon/standards/work-record-types_v0.1.md:
"Promotion is a first-class transition... manual transcription of an
intake item into other kinds is a process defect." This is what AWQ-010
needed and didn't have -- a human/agent had to notice, transcribe, and
re-register it by hand. One call now does what that manual pass did.

scripts/promote_intake.py: intake.routed -> workplan | task | decision |
engagement.
  - workplan: new ADR-001 file at workplans/{ID}-{slug}.md, registered
    against the hub (repo+topic resolution, POST /workplans, frontmatter
    id write-back)
  - task: appended as a ```task``` block to an existing --workplan-file,
    registered via POST /tasks, reuses the existing
    _inject_task_id_into_block writeback helper
  - decision: appended as a ```yaml``` block with a fresh
    {PREFIX}-DEC-{YYYY}-{NNN} id to --target-file, registered the same
    way C-32 registers decisions (reuses _inject_yaml_block_field)
  - engagement: appended as a ```yaml``` block with a fresh
    {PREFIX}-ENG-{YYYY}-{NNN} id -- file-only, no hub entity exists yet
    (same honest deferral as C-32), reported not silently skipped

In every case the intake is closed with outcome=promoted and
promoted_to=<new canonical id>; the new record carries an
origin: "intake:<id>" back-link.

Wired as `statehub promote-intake <intake-id> --to <kind> --repo-slug
<slug> --repo-path <path> --domain <domain> [--target-file ...]
[--workplan-file ...]`, matching the CLI shape named in the workplan text.

17 tests: pure helpers (_slugify, _next_number, _append_yaml_block,
frontmatter injection) offline; full promote_intake() flow with the hub
API mocked.

Live-verified against the real running API/DB and a real repo
(binky-control), not just mocks -- and the live proof caught a real bug:
the first workplan-promotion run silently produced a false success (the
intake was closed outcome=promoted, but /workplans/ actually 422'd on a
missing repo_id that the code never resolved, so no workstream was ever
created). Fixed to resolve repo_id via /repos/{slug} and to raise loudly
on registration failure instead of writing a half-registered file
silently; locked in as two regression tests. Re-verified clean:
workplan promotion (CLI direct + through `statehub promote-intake`
itself) and decision promotion both proven end-to-end against the live
hub, with all scratch artefacts (files + hub rows) cleaned up afterward.
No regressions: full state-hub suite (271 tests across
test_promote_intake, test_intake, test_work_record_registration,
test_work_record_check, test_routers_core, test_consistency_check,
test_consistency_sweep, test_mcp_smoke, test_mcp_write_tools) green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-21 01:06:01 +02:00
..
project_rules Add gitignore-claude template and wire into registration flows 2026-07-08 15:06:18 +02:00
backfill_codex_token_events.py Fixed and improved token tracking 2026-05-23 13:59:05 +02:00
benchmark_summary_cache.py feat(summary): revision-gated cache with stale-while-revalidate (STATE-WP-0066) 2026-06-22 16:27:32 +02:00
bootstrap-env.sh Fixed and improved token tracking 2026-05-23 13:59:05 +02:00
capture_legacy_meter_evidence.py Add 8-hour default window for legacy-meter deploy monitoring 2026-07-09 01:36:02 +02:00
capture_sbom_tools.py fix(api): normalize trailing slashes — no slash on param routes 2026-04-26 15:13:01 +02:00
check_doi.py fix(api): normalize trailing slashes — no slash on param routes 2026-04-26 15:13:01 +02:00
cleanup_stale_tasks.py STATE-WP-0070: identity headers, archive 0069, phase-2 workplan 2026-07-09 00:39:09 +02:00
codex-state-hub-mcp.sh chore: update standalone state hub wiring 2026-05-17 20:01:21 +02:00
compare_consistency_sweep_parallel.py finish(STATE-WP-0064): cut over scheduler and split sweep errors from failures 2026-06-22 01:20:59 +02:00
complete_statehub_bootstrap.py Extend complete_statehub_bootstrap for five Forgejo-migrated repos 2026-07-08 15:14:48 +02:00
consistency_check.py C-32: fix-consistency registration for intake/decision work records (CUST-WP-0061-T02) 2026-07-21 00:48:10 +02:00
dev_hub_up.sh feat(dev-hub): custodian dev up and files-first local hub (CUST-WP-0054-T07) 2026-07-08 11:42:49 +02:00
ensure_gitignore_claude_rules.py Add gitignore-claude template and wire into registration flows 2026-07-08 15:06:18 +02:00
gitea_inventory.py feat(CUST-WP-0014): repo sync automation & Gitea inventory 2026-03-16 01:41:16 +01:00
ingest_capabilities.py feat(capability-requests): add cross-domain capability catalog and request routing 2026-03-19 21:07:50 +01:00
ingest_sbom.py fix(api): normalize trailing slashes — no slash on param routes 2026-04-26 15:13:01 +02:00
ingest_tpsc.py feat(tpsc): Third-Party Services Catalog (CUST-WP-0023) 2026-03-20 00:15:26 +01:00
install_hooks.sh chore: add local consistency sync cli 2026-07-02 00:15:16 +02:00
mcp_hub_profile.sh feat(dev-hub): custodian dev up and files-first local hub (CUST-WP-0054-T07) 2026-07-08 11:42:49 +02:00
mcp_registration.py Rename MCP server identifier from state-hub to dev-hub 2026-06-22 20:46:14 +02:00
migrate_mcp_config.py Rename MCP server identifier from state-hub to dev-hub 2026-06-22 20:46:14 +02:00
normalize_attached_repo_workplans.py Fix workplan frontmatter join and prefix inference (STATE-WP-0067) 2026-06-22 23:16:15 +02:00
patch_mcp_cwd.py Rename MCP server identifier from state-hub to dev-hub 2026-06-22 20:46:14 +02:00
project_claude_md.template feat(register): modular @-import CLAUDE.md structure (ops-bridge pattern) 2026-03-16 18:35:02 +01:00
promote_intake.py CUST-WP-0061-T03: the promotion transition (statehub promote-intake) 2026-07-21 01:06:01 +02:00
propagate_credential_routing.py Add shared credential-routing template and propagation tooling 2026-06-18 22:48:43 +02:00
pull_image.py Add state-hub v0.1 — local-first state service for the Custodian 2026-02-24 17:47:49 +01:00
push-seal.md Load limiting safeguards 2026-05-06 04:04:53 +02:00
recently_on_scope.py Implement RecentlyOnScope domain digest 2026-05-22 13:45:53 +02:00
register-mcp.sh Rename MCP server identifier from state-hub to dev-hub 2026-06-22 20:46:14 +02:00
register_from_classification.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00
register_project.sh Add gitignore-claude template and wire into registration flows 2026-07-08 15:06:18 +02:00
repo_sync.py feat(consistency): T04 push seal — closed-loop writeback for automated commits 2026-04-21 01:43:40 +02:00
seed.py feat(api): CUST-WP-0018 — API hardening & code quality 2026-03-18 02:17:04 +01:00
seed_wp0012_suggestions.py Finish CUST-WP-0011 and implement STATE-WP-0061 suggestion backlog. 2026-07-06 10:52:49 +02:00
smoke_dashboard_load.sh Optimize dashboard overview loading 2026-06-06 00:42:00 +02:00
spine_migration_data.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00
spine_migration_dry_run.py feat(classification-spine): implement STATE-WP-0065 repo-anchored model 2026-06-22 13:52:13 +02:00
task_token_hook.py Fixed and improved token tracking 2026-05-23 13:59:05 +02:00
token_reconcile.py Fixed and improved token tracking 2026-05-23 13:59:05 +02:00
update_agent_instruction_files.py Add gitignore-claude template and wire into registration flows 2026-07-08 15:06:18 +02:00
validate_repo_adr.py STATE-WP-0070: identity headers, archive 0069, phase-2 workplan 2026-07-09 00:39:09 +02:00