feat(task): add task.code_prefix, reconciled into .ship-config - #217
Open
alex-mextner wants to merge 1 commit into
Open
feat(task): add task.code_prefix, reconciled into .ship-config#217alex-mextner wants to merge 1 commit into
alex-mextner wants to merge 1 commit into
Conversation
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.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds
task.code_prefixto rig.yaml, reconciled byrig applyinto.ship-config'sSHIP_TASK_CODE_PREFIX=<prefix>line. This is the rig-cli side of the fix for ship.sh's review-quorum gate only recognizingHYP-123/XX-123style 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_prefixin the schema.py wizard registry + config_schema.py'snot_pattern+ a real_validate_taskstructural check in config.py.provision_ship_task_prefixaction: 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").riglib/layers.py(REPO) andriglib/areas.py(status summary); drift detection wired inriglib/drift.py.docs/config-schema.md; regeneratedschema/rig.schema.json.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
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).