Skip to content

feat(cc-060): extract codex-dispatch timeout default + model alias SoT#131

Merged
screenleon merged 4 commits into
mainfrom
cc-060-dispatch-config-extraction
May 23, 2026
Merged

feat(cc-060): extract codex-dispatch timeout default + model alias SoT#131
screenleon merged 4 commits into
mainfrom
cc-060-dispatch-config-extraction

Conversation

@screenleon
Copy link
Copy Markdown
Owner

Summary

Implements both axes from docs/spikes/CC-060.md §2.5 (Q1=B bundled, Q2=A introduces ~/.pm-dispatch/config user-config file — first user-config precedent in the repo).

  • Axis 1 (timeout): _load_config_timeout() helper in scripts/codex-dispatch.sh. Precedence chain: brief field > CODEX_DISPATCH_TIMEOUT env > ~/.pm-dispatch/config dispatch.default_timeout > 1200 fallback (1200 preserved as floor). Parser is shell-source-able key=value, ignores blanks/comments/unknown keys, warns on malformed lines, captures dispatch.default_model as a reserved key.
  • Axis 2 (model alias SoT): New share/model-aliases.tsv becomes the single source of truth for PM-alias → wire-format model + reasoning effort. declare -A maps removed from codex-dispatch.sh; runtime _resolve_model_alias() reads from TSV with fail-loud semantics. New scripts/lint-model-aliases.sh enforces drift detection (TSV ↔ doc table ↔ template references ↔ test coverage), wired into the lint-scripts CI job. docs/dispatch-brief.md aliases section now cites the lint instead of the prior manual sync warning.
  • README: documents ~/.pm-dispatch/config as optional, user-managed, never installer-created. Current keys = dispatch.default_timeout + reserved dispatch.default_model.

Refs CC-060 (epic), CC-242 (spike ticket — already registered in BACKLOG.md with spike doc at docs/spikes/CC-060.md).

PR shape note

Brief asked for axis-split commits; squashed here because codex sandbox lacked git write access and reviewer = audience-of-one (pm-dispatch is solo per project posture). The squash includes all axis-1 + axis-2 + shared doc/CI edits as one commit on top of the spike + backlog commits.

Gate findings (evaluated, not tracked)

/pr-gate (full tier) returned GO with verdict advise. Two [low] findings from qa-tester were evaluated and not followed up:

  1. lint-model-aliases.sh lacks direct error-path tests (malformed TSV, duplicate alias) — blast radius is one PR round-trip; runtime path (_resolve_model_alias) still fail-loud on bad TSV. Skipped.
  2. Missing/corrupt dispatch.default_timeout boundary fixtures — parser behavior implemented (warn + fall-through to env/1200); worst case is unexpected-but-safe timeout. Skipped.

Both findings have near-zero real risk; documented here in lieu of a tracked backlog ticket so future-me has the trail.

Test plan

  • bash scripts/lint-scripts.sh — 50 files OK
  • bash scripts/test-codex-dispatch.sh — 19/19 (3 new axis-1 fixtures pass)
  • bash scripts/test-dispatch-handover.sh — 65/65
  • bash scripts/test-hooks.sh — 306/306
  • bash scripts/lint-model-aliases.sh — exit 0
  • bash pm/scripts/validate.sh BACKLOG.md — 31 E-* (== pre-existing CC-228 baseline, no regression)
  • shellcheck --severity=style — not installed locally; CI will run it

🤖 Generated with Claude Code

screenleon and others added 4 commits May 23, 2026 11:21
Implements both axes from docs/spikes/CC-060.md §2.5 (Q1=B bundled, Q2=A
introduces ~/.pm-dispatch/config user-config file).

Axis 1 — timeout:
  - scripts/codex-dispatch.sh: _load_config_timeout() helper. Precedence:
    brief field > CODEX_DISPATCH_TIMEOUT env > ~/.pm-dispatch/config
    [dispatch.default_timeout] > 1200 fallback (1200 preserved as floor).
  - Parser ignores blanks/comments/unknown keys, warns on malformed lines
    or non-integer dispatch.default_timeout, and captures
    dispatch.default_model as a reserved key (no consumer yet).
  - docs/dispatch-brief.md: new "Env / config precedence" subsection +
    example ~/.pm-dispatch/config; CODEX_DISPATCH_TIMEOUT promoted to
    documented public env.
  - scripts/test-codex-dispatch.sh: 3 new fixtures (env-only, config-only,
    brief-field beats both).

Axis 2 — model alias SoT:
  - share/model-aliases.tsv: new SoT (codex-spark -> gpt-5.3-codex-spark /
    high), tab-separated with header comment + schema.
  - scripts/codex-dispatch.sh: declare -A MODEL_ALIAS_TO_{ID,EFFORT} maps
    removed; runtime _resolve_model_alias() reads from TSV with fail-loud
    semantics if missing/unreadable/malformed. Snapshot copy preserved so
    re-execed snapshot still reads the SoT.
  - docs/dispatch-brief.md: aliases section now references the TSV and
    cites scripts/lint-model-aliases.sh as the drift check (replaces the
    prior "must keep in sync" warning).
  - scripts/lint-model-aliases.sh: new lint asserting TSV parse + doc
    table byte-equivalence + alias coverage in tests + dispatcher uses
    the runtime loader path.
  - .github/workflows/lint.yml: wires lint-model-aliases.sh into the
    lint-scripts job.
  - README.md: dispatch script paragraph documents ~/.pm-dispatch/config
    as optional, user-managed, never installer-created; current supported
    keys + reserved dispatch.default_model.

Local self-verify: lint-scripts OK, test-codex-dispatch 19/19,
test-dispatch-handover 65/65, test-hooks 306/306, lint-model-aliases
exit 0, validate.sh BACKLOG.md emits 31 E-* (= pre-existing CC-228
baseline). shellcheck not present in env; CI will run it.

Brief asked for axis-split commits; squashed here because codex sandbox
had no git write access, and reviewer = audience-of-one (per
[[project_japanese-site_audience]]-style override; pm-dispatch is solo).
PR description carries the rationale.

Refs CC-060, CC-242.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- scripts/lint-model-aliases.sh:23: cleanup() is invoked indirectly via
  `trap cleanup EXIT`. shellcheck SC2329 ("function never invoked")
  doesn't recognize trap callers. Add an inline `# shellcheck disable`
  comment with the reason. CI test-skill-refine job was failing on this
  warning; local lint passed because shellcheck wasn't installed locally
  (exactly the [[feedback_ci_shellcheck_stricter_than_local]] scenario).

- BACKLOG.md:141: CC-060 was still marked ⏸ deferred from before the
  spike; with PR #131 in flight implementing the bundled timeout +
  model SoT extraction, flip status to 🔵 active and update Refs to
  pr:#131. Priority bumped to P2 and epic set to design to match the
  scope. The brief that produced commit b360d21 told PM "keep original
  status/date columns unchanged" — that was my mistake; status should
  have flipped together with the description rewrite.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@screenleon screenleon merged commit f55ee8b into main May 23, 2026
16 checks passed
@screenleon screenleon deleted the cc-060-dispatch-config-extraction branch May 23, 2026 03:08
screenleon added a commit that referenced this pull request May 23, 2026
CC-243 shipped the snapshot script + PM agent's ingestion-rule but no
caller invoked the script — it was shelf-ware in main. This wires
`commands/pm.md` (the canonical /pm entry point) to:

1. Run `scripts/pm-prep-snapshot.sh` from the target repo's working
   directory before invoking the project-pm agent.
2. Parse any `CC-\d+` IDs from $ARGUMENTS and pass them as --focus.
3. Inject `snapshot_file: <abs-path>` into the PM brief context.
4. Degrade gracefully if the script errors (e.g. target repo has no
   BACKLOG.md — common when /pm is invoked from japanese-site or
   another non-pm-dispatch repo); skip the snapshot but proceed with
   the dispatch.

PM's `## Snapshot ingestion` section (added in CC-243 to
`agents/project-pm.md`) already treats `snapshot_file` as ground
truth, preferring it over caller-brief prose for commit SHAs / ticket
IDs. This commit closes the loop.

Local verify: validate.sh BACKLOG.md emits 30 E-* lines (one below
the CC-228 baseline of 31, carried over from the CC-060 #131
ref-cleanup).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
screenleon added a commit that referenced this pull request May 23, 2026
…tate (#143)

Closes 4 in-flight rows whose work shipped 2026-05-23 but status was
not flipped; aligns MILESTONES.md M0 table with the actual shipped
state; clears the CC-219 freshness gate's blocking findings.

Closed (status + body):
- CC-241 v0.2.0 doc-drift cleanup — closed on inspection (a/b/c already
  fixed before audit; no edit required, row closed by status flip)
- CC-219 pre-milestone doc-freshness gate — shipped via #129
- CC-060 codex-dispatch param extraction — shipped via #131
- CC-243 pm-prep-snapshot — shipped via #132

Fixed pr:TBD on closed rows (per CC-219 gate U3):
- CC-243 → pr:#132
- CC-246 → pr:#134

MILESTONES.md v0.3.0 M0 table — flipped all 6 rows from ⏳ to ✅
with merged-PR refs; added "✅ complete 2026-05-23" header to the M0
section. CC-229..CC-232 (M1) remain ⏳ and are the next gate.

Validator parity preserved at 30 pre-existing E-codes (CC-228 baseline).
`scripts/check-docs-freshness.sh` blocking findings cleared (1 WARN
remains: CC-249 pr:TBD, expected — spike-pending).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant