Skip to content

feat(task): add task.code_prefix, reconciled into .ship-config - #217

Open
alex-mextner wants to merge 1 commit into
mainfrom
feat/task-code-format-config
Open

feat(task): add task.code_prefix, reconciled into .ship-config#217
alex-mextner wants to merge 1 commit into
mainfrom
feat/task-code-format-config

Conversation

@alex-mextner

Copy link
Copy Markdown
Owner

Summary

Adds task.code_prefix to rig.yaml, reconciled by rig apply into .ship-config's SHIP_TASK_CODE_PREFIX=<prefix> line. This is the rig-cli side of the fix for ship.sh's review-quorum gate only recognizing HYP-123/XX-123 style task codes — a repo whose task-cli backend is GitHub Issues (bare #NNN) could never derive a task code and was permanently refused. Companion PR: agent-tools#356.

What's included

  • task.code_prefix in the schema.py wizard registry + config_schema.py's not_pattern + a real _validate_task structural check in config.py.
  • A new provision_ship_task_prefix action: merges into .ship-config (never overwrites), collapsing pre-existing duplicate managed lines to one, with keyed conflict semantics matching _do_register_mcp (the managed line conflicting is the only real conflict — not "the file exists").
  • Registered in riglib/layers.py (REPO) and riglib/areas.py (status summary); drift detection wired in riglib/drift.py.
  • Documented in docs/config-schema.md; regenerated schema/rig.schema.json.
  • Re-validates the 1-40-uppercase-letters/digits contract in Python at plan-build time (not just the schema, which validate() doesn't enforce for any block); rejects (not silently coerces) an unquoted numeric YAML value with a note to quote it; notes rather than drops a non-string/non-mapping value.

Test plan

  • 33 tests: plan gating, the merge-write (create/upsert/idempotent/backup/dedup/keyed-conflict), boundary cases, drift detection, registry-wiring sanity check.
  • Full suite: 2339 passed, 2 pre-existing/environmental failures unrelated to this change (missing optional deps on this dev machine; an e2e-gating test file this change never touches).

Deferred (tracked, not blocking)

rig-cli#216 — line-ending/CRLF byte-parity between drift and apply, atomicity of the merge write, and a couple of bypass-only edge cases (all low severity, surfaced during review).

ship.sh's review-quorum gate only recognizes HYP-123/XX-123 style task
codes. A repo whose task-cli backend is GitHub Issues (bare #NNN, no
ticket-code convention of its own) could never derive a task code and
was permanently refused by the gate (companion agent-tools#356).

Adds task.code_prefix to rig.yaml (schema.py wizard registry +
config_schema.py's not_pattern + a real config.py _validate_task
structural check, all required to stay in sync) and a new
provision_ship_task_prefix action: rig apply merges
SHIP_TASK_CODE_PREFIX=<prefix> into the repo's .ship-config, preserving
any existing SHIP_LOCAL_TEST_DIR/SHIP_LOCAL_TEST_CMD content rather than
overwriting the file, and collapsing a pre-existing duplicate managed
line to one instead of accumulating copies. Unset (default) touches
nothing.

Registered task in riglib/layers.py (REPO) and riglib/areas.py (status
summary), and wired drift detection (riglib/drift.py::
_check_ship_task_prefix) so a hand-edited or deleted SHIP_TASK_CODE_PREFIX
line is flagged, not silently reported clean — status/apply parity like
every other reconciled area. Documented in docs/config-schema.md.
Regenerated schema/rig.schema.json.

Re-validates the 1-40-uppercase-letters/digits contract in Python at
plan-build time (not just the schema's not_pattern) so a malformed
prefix refuses before ever writing a .ship-config ship.sh would later
ignore wholesale. Rejects (rather than silently coerces) an unquoted
numeric YAML value with a note telling the author to quote it, since
the schema declares the type as string. Notes rather than silently
drops a non-string/non-mapping config value so a typo doesn't fail
silently.

28 tests: plan gating, the merge-write (create/upsert/idempotent/
backup/dedup), boundary cases (40/41 chars, empty=unset, non-ASCII
lookalikes, non-mapping task block, malformed-type feedback), drift
detection, and a registry-wiring sanity check across every touched
registry. Full suite: 2334 passed, 2 pre-existing/environmental
failures unrelated to this change (already flagged earlier this
session — one a missing optional-deps check on this machine, one a
ModuleNotFoundError for an e2e-gating test file this change never
touches).

Deferred, tracked separately (rig-cli#216): preserving original
.ship-config line-ending style (CRLF/no-trailing-newline) so the merge
is a true byte-identical no-op when only the prefix line already
matches — low-severity cosmetic churn, not a data-loss risk.
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

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