Known Issues & Lessons Learned

Project-specific gotchas live here; high-level CRAIG patterns (problem-type URL catalogue, RFC 9457 discipline, authz cousin-handler pattern, etc.) live in the Antora docs under docs/modules/ROOT/pages/. User-specific behavioral preferences live in user-local agent auto-memory. Read all three when investigating an unfamiliar failure mode.

Known Issues

  • Lost exec bit on .githooks/* (lesson 2026-06-07): Git stores the executable bit in the tree (100755 vs 100644). Cloning on Windows without core.fileMode set, an over-eager chmod -x .githooks/, or a clean re-add after chmod 644 can land the hooks at 100644. With core.hooksPath .githooks still set, Git silently no-ops the hook (treats it as non-executable text) and unvalidated code reaches the remote. cargo xtask lints hooks-exec, a gate-table row and so a line of the car (whose MR filter includes .githooks/*; #1739 replaced the hooks-exec-check job), is the regression gate — it reads the index and fails naming the offending path and mode. Fix: chmod +x .githooks/* && git add --chmod=+x .githooks/* && git commit.

  • RabbitMQ user: Must be in definitions.json with SHA-256 hash (not env vars).

  • Keycloak token lifetime: 30 min. Long test sessions may hit 401s.

  • E2E seed-manifest alignment: tests/e2e/lib/seed.ts is committed and gets regenerated on cargo xtask e2e from the current CRAIG_SEED + CRAIG_FAMILIES env vars (defaults: 42 / 12). The committed file must match those defaults or fresh cargo xtask dev start seeds the DB with one shape while specs import IDs from another, and symptoms look like locator.selectOption: Timeout 10000ms exceeded. The generator itself is byte-deterministic for identical inputs — guarded by manifest_is_byte_deterministic_across_runs in tools/craig-seed/tests/integration.rs. If the committed manifest goes out of sync, regenerate with defaults: cargo xtask config fetch, then CRAIG_CONFIG_SOURCE="federal=path:target/config/layers/federal, georgia=path:target/config/layers/georgia" CRAIG_CONFIG_ALLOW_UNVERIFIED=true cargo run -p craig-seed — --seed 42 --families 12 --output-dir tests/e2e/.seed-sql --manifest tests/e2e/lib/seed.ts (the seed takes its jurisdiction and rate schedule from the configuration layers; CRAIG_CONFIG_SOURCE is required). E2E specs should avoid index-based lookups (casesList[0]); use the exported findCase/findHome/etc helpers with a predicate instead.

  • CI 2xlarge runner disk OOM is recurring: ld: final link failed: No space left on device during cargo nextest --workspace is upstream-runner infra, not code. The merge train is the merge gate (ADR-086), so a car whose job died this way is dropped and re-added once the failure is named on an issue — see Landing an MR (the merge train is the merge gate) below, which also lists what CI runs beside the car.

    Mitigation (#1645): the jobs that build the full workspace with test binaries — the car, feature-matrix — run off the shared dhs-aws-autoscaler-docker.2xlarge pool on $CI_RUNNER_TAG, the pipeline default dhs-aws-autoscaler-docker-4xlarge (a 1 TB disk per job VM; #2923), like every job. There is no fallback runner (ADR-086 § D3, amended 2026-11-07): if the 4xlarge is unavailable (offline, mid-provisioning, tag not registered) every job stalls with no runner rather than OOM, and the train waits with them. Name the outage on an issue.

  • The car blocks on a merge train and on an MR (#2923, ADR-086; #3028): one car job runs the developer’s commands (Quality Gates § CI: the car). On a train pipeline it runs and blocks, and a red car drops the car. On a plain MR pipeline it runs and blocks too. A car whose change is documentation no lane reads stops after its gates, a success with no JUnit report (#3101; Landing an MR (the merge train is the merge gate)). Fix a red MR car before adding the car to the train. No job is retried (ADR-086 D4): a dropped car is fixed and re-added (Landing an MR (the merge train is the merge gate)).

  • Keyed devstack: craig-cases refuses boot on key↔data mismatch (since epic &66 C7, #987): at startup cases verifies the mounted CRAIG_FIELD_ENCRYPTION_KEY against the seeded data’s crypto_key_lineage anchor (ADR-048 §D3) and refuses to start on a mismatch — compose then reports dependency craig-cases failed to start. The xtask paths self-heal (the .devstack/field-key.kcv staleness marker forces the wipe + keyed reseed automatically), but one edge does not: if .devstack/ markers are absent while an old data volume persists (fresh clone against an existing volume, or a manually cleared .devstack/), dev start takes the cold-start path — no staleness check runs — and cases refuses boot with KeylessLineageWithKey/KcvMismatch. Since #1007 (ciphertext envelope format v2, ADR-048 § Amendment — #1007) the same cold-start edge over a volume seeded under v1 refuses with SchemeMismatch (the lineage row says envelope_version = 1; the v2 binary speaks 2) — the xtask paths self-heal through the .devstack/envelope-format marker (wipe + keyed reseed BEFORE the rebuilt image starts), the cold start does not. This is the designed defense-in-depth, not a bug; every refusal message names the fix: cargo xtask dev reseed.

  • Inbox retries past strike 2 are operator-paced (epic &77 / ADR-062 §A, 2026-08-02): a failing MQ handler gets exactly TWO automatic attempts (broker 2-strike: nack-requeue, then reject → DLQ). The #1197 parking replayer serves the DLQ consumer’s own failures ONLY — nothing automatic returns a dead-lettered envelope to the source queue; attempts 3–5 come from the ADR-022 §D4 admin replay, and the counted-attempt budget (error_count, terminal at 5) spans those cycles. Symptom in tests/ops: an event_inbox row stuck at error_count=2, processed_at NULL is WAITING FOR AN OPERATOR, not retrying. Beyond-grace watchdogs + DLQ depth gauges are the signals. The operator escape is recorded in the archived Transactional Idempotency Claims plan § A-5 Retry policy — a CONDITIONAL DELETE FROM event_inbox WHERE envelope_id = $1 AND failed_at IS NOT NULL + an audit note, then the §D4 replay; never a raw delete (ADR-062 itself carries only the one-line pacing rule under § MQ inbox, "One retry policy" — there is no runbook section). Since #1941 that replay is a budgeted keyset loop: at most 20 × 5 000 rows per call, more = true
    resume_from when the window holds more — pass the cursor back with the SAME from / to / event_type and loop until more = false. A fault-injection test whose fault does not self-clear before strike 2 can therefore never converge — see the cases degraded_pass_is_refused_counted_and_converges_on_the_retry leg for the self-disarming-trigger pattern that keeps such tests deterministic.

  • request_claims replays are bounded by a 30-day horizon (epic &77 §B, ADR-062 §H): a client retry of a convert-class POST after CRAIGREQUEST_CLAIMSWINDOW_DAYS (default 30; 0 disables retention, never the guard) is a NEW operation by design — the claim row was pruned. Same boundary for §U upload/export attempts at the 31-day tombstone retention. This is the documented fresh-attempt boundary, not a bug.

  • RabbitMQ ≥4.2 metadata writes can transiently time out under I/O contention (Khepri) (#1401, forensics 2026-08-11): the broker’s Raft-backed Khepri metadata store makes a transient consensus-write timeout a DESIGNED failure mode — queue.declare/queue.bind answer with a connection-class INTERNAL-ERROR: … metadata store operation timed out (which closes the whole connection), typically minutes after a broker recreation (the volume-less broker cold-starts the store, including the Mnesia→Khepri table migration, on every recreate) under battery-tail disk contention. Posture: the image is pinned to an exact patch (devstack/rabbitmq/Dockerfile — the store engine can never change under an infra rebuild again); the test harness’s EventCollector retries the transient class boundedly with a fresh connection per attempt (craig-test-lib events.rs, fail-loud after 5); production subscriptions already self-heal via craig-mq’s supervised reconnect loop (its module doc: reconnect with capped backoff
    redeclare), so no per-declare retry was added there. Anything OTHER than the INTERNAL-ERROR class (ACCESS-REFUSED, PRECONDITION-FAILED, …) still fails immediately.

  • An AMQP establishment can stall past craig-mq’s 15 s liveness bound at host peak (#1783; captures 2026-09-11/12, both before the 2026-09-19 storage move, one beside a co-tenant release build at load 30–37 on 32 cores; none since): the shape is AMQP session build for queue <q> (in <step>) exceeded 15s, AMQP replayer session build for queue <q> exceeded 15s, or connect_owned’s own `AMQP tcp connect exceeded 15s / AMQP amqp handshake exceeded 15s (a session build’s connect step often surfaces as these: testing-reference.adoc § AMQP establishment stalls). Trigger: a broker-side stall on the named step (connect = the TCP dial plus the AMQP handshake; queue declare + bind / dlq companions = a Khepri metadata commit, the same fdatasync path as the INTERNAL-ERROR entry above) or a starved test process. The failing test prints an establishment witness (craig_test_lib::amqp_witness), taken AFTER the expiry: a slow Connection.Start with a fast management API means the broker’s AMQP path is still stalled; fast probes mean only that the stall had cleared by probe time — read them with the named step, the host PSI and the broker uptime (a short uptime is the cold-store window after a recreation). On recurrence attach the witness to #2358, the open owner of this class. The bound is NOT widened and the suite is NOT serialized (testing-reference.adoc § AMQP establishment stalls).

  • A journey’s event wait expired once; the occurrence is classified and fixed, and the next one classifies itself (#1897, 2026-09-15, single occurrence, CI job 16523564871: the e2e leg straight after the full nextest battery). journey-case-full-spine read the placement’s assignment pair as [null, null] for 30 s. Playwright’s retries: 1 replays the same run ids, so the retry re-polled the SAME placement, and the test failed after about 60 s. The job’s test-results/ artifact (kept until 2026-10-15) rules out every delivery class: craig-placement handled the case’s case.created 155 ms after the case id was minted, with placements_healed: 0, inside the 46 ms POST /v1/placement/placements that created the placement. The create’s FOR SHARE on the still-absent projection row locked nothing, so neither transaction saw the other: a lost heal. #1901’s per-case advisory lock closes that race in production, #2065’s episode given waits it out, and the spec now reads the born row once, so a regression fails at once instead of after a poll. If an event wait expires again (given.removal-episode: … has not processed its case’s case.created (#2065) or no per-diem for placement …), three delivery classes fit the source: relay lag (the outbox drain; since #2593 a pass of 2 s or more logs outbox drain pass slow naming its phase), consumer session loss (the Khepri timeout and the capped reconnect backoff above) and a dead-lettered delivery (the operator-paced 2-strike ladder above). On recurrence: attach test-results/e2e/transport-legs.txt and service-logs-on-failure.txt to a new fix: issue naming the class before any remediation; never raise the 30 s.

  • CI raw-compose devstack jobs need the CRAIG_CI_AGE_KEY project variable (ADR-064 U7, #1385; was CRAIG_FIELD_ENCRYPTION_KEY pre-switchover): the compose file env_file-requires devstack/field-key.env; the pentest/perf jobs materialize it via cargo xtask secrets write-field-key, which decrypts the repo-committed store (secrets/dev.yaml) with the masked + protected CI age identity CRAIG_CI_AGE_KEY (minted via cargo xtask secrets init --for-ci; see #1031). Unset variable ⇒ the verb hard-errors naming this fix (ADR-048 §D5: never a keyless CI devstack). Protected means the identity never reaches an unprotected branch. There (GitLab’s CI_COMMIT_REF_PROTECTED is false) the verb says so and writes nothing, and dev start mints a throwaway key, so a perf measurement started on a branch runs (#3185); on a protected ref an unset variable is still the hard error. These jobs remain allow_failure for the unrelated recurring runner-infra reds (disk OOM, above).

  • Screening routes may answer 503 screening-surface-not-ready (detail: "unreachable") in the first seconds after dev start / dev reseed (#1727): craig-cases’s screening-surface-verifier probes craig-rules at boot; if rules is not answering yet the probe fails and the verifier retries after 2 s, doubling (2/4/8/16/32 s) to the 60 s ceiling until the first successful pass flips the gate. The devstack lifecycle verbs return on container health, which the gate does not feed (/readyz is untouched by design), so a screening call fired right after the stack reports healthy can land inside the current ladder step — wait a few seconds and retry; the in-process suites sidestep it by calling verify_once through the keyed harness before the first act.

  • Seed rules receipt: one cold loaded start reported two COMMITTED rulesets missing (#1691, 2026-09-05, root cause OPEN — entry stays until it is understood): during the pre-push battery’s e2e leg (full wipe
    --profile fault up, host load ≈15) the seed’s up-front psql … SELECT name || '=' || version FROM rule_sets snapshot lacked exactly two of 123 rows (georgia-authz-afcars_submission=1.1.0, georgia-placement-matching=v1.0) that the API by-name read in the SAME receipt loop served, and that were present and correct (revision = 1, created_at inside the seed run) minutes later. The create route commits before it answers 200 and the API read is a plain store read on the same single Postgres, so the evidence is contradictory. Since #1691 the receipt takes the API read as its authority (the path the loader converged against), keeps the psql snapshot as an independent witness, and on a disagreement re-reads the DB once per name and logs the row it holds (name|version|active|revision|created_at / (no row)): a snapshot-only miss is a WARNING: #1691 — … line (not fatal), a persistent DB-side miss still fails the seed. On recurrence: capture the seed log (cargo xtask dev logs craig-seed), note the snapshot line count and the dumped row on the WARNING line, and attach both to #1691 before any remediation — do not restart blindly.

Workflow tool misuse: scout agents that edit files (2026-06-04 lesson)

When launching a Workflow with parallel subagents for scouting (categorize emissions, draft a per-crate playbook, etc.), the agents may interpret their task as "make the workspace fit the plan" and start editing files in parallel. During Plan M Tier 1d, a scout-only workflow commented out the Plan H Step 2 transitional allow blocks across multiple crates simultaneously, leaving the working tree broken across 13+ lib roots. The agents thought they were "probing what would fire" — but the edits were uncoordinated and conflicting.

Mitigation:

  1. Explicitly frame scout prompts as "read-only; no file edits". Repeat the constraint at the end of the prompt where it’s likely to be re-read.

  2. If parallel file mutation is genuinely needed, set isolation: 'worktree' so each agent gets its own checkout.

  3. For force-merge-serialized lift work (Plan M MRs ship one at a time through the force-merge runbook), Workflow adds overhead without parallelism — execute sequentially in the main loop. The single-agent inline loop is the right shape.

  4. Recovery: if a scout workflow has already edited files, TaskStop the workflow, then git checkout — . to revert all unwanted edits. Save only the intentional edits done outside the workflow.

PUT /merge returns 405 while detailed_merge_status: preparing (2026-06-05 lesson)

This is distinct from the 405 Method Not Allowed a direct merge (a PUT …/merge without auto_merge) always gets under merge trains, by design (Landing an MR (the merge train is the merge gate) below). When opening a new MR via the GitLab API, the MR sits in detailed_merge_status: preparing for ~10-30s while CI registers; PUT /merge_requests/N/merge during this window also returns 405. Mitigation: poll detailed_merge_status until it leaves preparing before issuing PUT, OR retry the PUT after a 30s sleep — the same call succeeds once the state advances.

Additionally observed during Plan M force-merges: the PUT can return 405 even with cancel=200 immediately preceding, because the cancel hasn’t propagated. A re-check of MR state right after a 405 sometimes shows state: merged — the actual merge landed during the call’s race window. Always verify merge outcome via a follow-up MR fetch or git ls-remote, not the PUT exit code alone.

curl -sf swallows JSON-error bodies on 4xx/5xx. When debugging merge-call failures, switch to curl -X PUT without -sf and pipe through python3 -m json.tool to see the actual error body — the message field tells you whether the failure is 405 not_mergeable, 405 preparing, or a downstream conflict.

Landing an MR (the merge train is the merge gate)

ADR-086 records the ruling: a GitLab merge train is the merge gate. Each car’s train pipeline runs the whole car on main merged with the cars ahead of it, and every job blocks; the car’s lines and their order are described once, in Quality Gates § CI: the car. A red job drops the car. The project requires a green pipeline (only_allow_merge_if_pipeline_succeeds) and allows no skipped pipeline and no skipping the train, so the only way in is the train. The pre-push hook is the fast battery (fmt, the static lints, clippy and the unit tests; local-dev § CI vs Local Differences): it catches the cheap failures before a car takes a train slot.

A docs-only car (#3101): when every file the merge changes is documentation no lane reads, the car job runs its gates and then ends as a success, with the line car-scope: docs-only (…) in its log. It builds no stack and runs no lane, so it uploads no test-results/ and a merge note has no JUnit to cite: cite the car-scope line. An error car-scope: the whole car runs: <reason> names the first path that is not documentation, or why the commit could not be proved; Quality Gates § CI: the car has the definition.

GITLAB_TOKEN lives in /home/bitskrieg/code/craig/.env.local (not in global config); source it explicitly before running the commands below.

An agent running under gadhs/pi asks before a push or one of these merge calls only when your own pi overlay lists them; Contributor Onboarding § Guarding push and merge under gadhs/pi has the patterns.

The procedure

Push the branch (the fast hook runs on the push and must pass), open the MR, then add it to the train with auto_merge=true. A direct merge answers 405 Method Not Allowed by design: the same PUT …/merge without auto_merge asks GitLab to merge around the train, and the settings forbid that. A 405 there is the normal state, not a fault to work around.

PROJECT=gadhs%2Fapplication%2Fccwis%2Fcraig
API="https://gitlab.com/api/v4/projects/$PROJECT"

# 1. Open the MR. mr.json carries "source_branch", "target_branch": "main", the "title"
#    (the issue's title + " (#N)"), the "description" (Summary / Changes / Test Plan,
#    "Closes #N"), "remove_source_branch": true and "squash": false.
IID=$(curl -sS -X POST -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -H "Content-Type: application/json" \
  --data-binary @mr.json "$API/merge_requests" \
  | python3 -c "import json,sys; print(json.load(sys.stdin)['iid'])")

# 2. Wait until detailed_merge_status leaves `preparing` (a PUT before then also returns 405).
mr_status() {
  curl -sS -H "PRIVATE-TOKEN: $GITLAB_TOKEN" "$API/merge_requests/$IID" \
    | python3 -c "import json,sys; print(json.load(sys.stdin)['detailed_merge_status'])"
}
for _ in $(seq 1 12); do [ "$(mr_status)" != preparing ] && break; sleep 5; done
mr_status

# 3. Add the car to the train: a merge commit, never a squash; the source branch is removed.
curl -sS -X PUT -H "PRIVATE-TOKEN: $GITLAB_TOKEN" -H "Content-Type: application/json" \
  -d '{"auto_merge":true,"should_remove_source_branch":true,"squash":false}' \
  "$API/merge_requests/$IID/merge"

# 4. Confirm the car is on the train (status idle/fresh, its train pipeline id) ...
curl -sS -H "PRIVATE-TOKEN: $GITLAB_TOKEN" "$API/merge_trains/merge_requests/$IID" \
  | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['status'], (d.get('pipeline') or {}).get('id'))"

# 5. ... and, once the train pipeline is green, verify from a fresh fetch: expect `merged <sha>`.
curl -sS -H "PRIVATE-TOKEN: $GITLAB_TOKEN" "$API/merge_requests/$IID" \
  | python3 -c "import json,sys; d=json.load(sys.stdin); print(d['state'], d.get('merge_commit_sha'))"

Step 2 is the PUT /merge returns 405 while detailed_merge_status: preparing (2026-06-05 lesson) lesson above. A status that names a conflict or a missing approval blocks step 3: resolve it first (a conflict: rebase onto main, never merge main into the branch). A pipeline still running on the MR does not block it: auto_merge adds the car anyway, and the train runs its own pipeline. Step 5 is that lesson’s rule too: trust the MR’s state, not a response code.

Reading a train pipeline

A car’s train pipeline is labelled merge train in the MR’s pipeline list ($CI_MERGE_REQUEST_EVENT_TYPE == "merge_train"). It tests a temporary commit: main plus every car ahead of this one plus this MR. Every car job runs, whatever the MR changed, and none may fail. The path-filtered required jobs (secrets-policy, cargo-deny) run when their inputs changed; ci-image, xtask (with the docs' content lints) and docs run on every car. docs may fail with exit 42 alone, its dead-external-link verdict. The car uploads its JUnit reports (the pipeline’s Tests tab) and, when red, the stack’s container logs. Reproduce a red line locally with the same command, for example cargo xtask test --integration --profile ci-integration after cargo xtask dev start (local-dev § CI vs Local Differences); cargo xtask validate runs every line in order.

A plain MR pipeline (merged-results or detached) runs the car, blocking, when code or a stack input changed, so a red car shows before the MR joins the train (#3028).

A dropped car

A red train pipeline drops the car. GitLab removes the MR from the train with a system note, the MR stays open, and the cars behind it restart without it. Fix it and re-add it; never retry it (ADR-086 D4, no retries):

  1. Read the red job and reproduce its red line with the same cargo xtask command.

  2. A real failure: fix it on the branch, push (the fast hook runs), and repeat step 3.

  3. A flake (a failure that does not reproduce): file it as an issue (fix:, with the job link) and fix it. The car goes back on the train with the fix, or with the issue named on the MR when the fix is its own MR. Each flake counts toward ADR-086’s flake-rate tripwire.

  4. An infrastructure failure (runner_system_failure, an interrupted or stuck runner): name it on an issue, then repeat step 3. If the 4xlarge has picked up no job for an hour, the train is stopped: there is no fallback runner (ADR-086 § D3, amended 2026-11-07), so keep the outage on its issue and re-add the car once the 4xlarge is back.

Never press retry on a job in a train pipeline, never cancel a train pipeline to get a car through, and never merge around the train.

To take a car off the train yourself (to rework it before its pipeline finishes), cancel its auto-merge:

curl -sS -X POST -H "PRIVATE-TOKEN: $GITLAB_TOKEN" \
  "$API/merge_requests/$IID/cancel_merge_when_pipeline_succeeds"

If a merge ever lands without a green train pipeline, or a direct PUT …/merge succeeds, the project or group settings have drifted. That is an ADR-086 tripwire: stop landing, restore the settings, and file a fix: issue.

What CI runs beyond the car, and where it is triaged

The car is the battery, one job running the developer’s commands; its lines, in order, are Quality Gates § CI: the car. Beside it:

  • xtask: compiles xtask once for the pipeline (#2982), then three gates (mandatory-docs, plan-lint, doc-pointer-integrity), which answer in minutes; the car runs them again among its gates.

  • cargo-deny and secrets-policy (cargo xtask secrets policy: recipient parity and the secret-key needle; the car’s sops-policy lint is the deep check) on MR pipelines whose inputs changed. cargo-deny is CRAIG’s one RustSec scanner (#2658); it also runs on main when its inputs changed and on every scheduled pipeline.

  • Security and supply-chain scans: GitLab’s sast, secret_detection and dependency_scanning template jobs (the battery’s secret scan is its own gitleaks run over .gitleaks.toml). The RustSec advisory scan is `cargo-deny’s.

  • Policy jobs: secrets-policy’s keyed arm on `main, tags and schedules (a dedicated check that the CI age identity decrypts the store; pentest and perf-* also decrypt it through cargo xtask secrets write-field-key), docs (the full Antora build at --log-failure-level=warn; validate’s doc-attr-refs lint is a local proxy for one of its failure classes). The same job checks the external links and allows only that verdict’s exit 42 (network-dependent, so never a gate; #1337, #2981).

  • Build checks: feature-matrix (cargo xtask feature-matrix, the plugin feature builds).

  • Images, SBOM and release: release-build (builds, smoke-tests and pushes the service images on tags, the weekly schedule and by hand on main, #3045), release-sbom (the SBOM, on tags and the schedule, #3167), release-notes and release (tags).

  • Pages: docs (also the MR docs preview, #2984) and pages (main).

  • Scheduled and main jobs: pentest (the ZAP and ffuf phases the car’s security line skips), perf-load and perf-stress on schedules, or manual on main (#2985: weekly, not per merge; each brings up its own stack, #3045), or alone in a measurement pipeline on a branch (MEASURE=<job>, #3178); cluster-tests (the CLUSTER_TESTS=true schedule, the cluster-tests MR label, or manual on main); policy-drift (the POLICY_DRIFT=true schedule); and the advisory coverage-floor (schedules).

Where the results are read:

  • The car’s train pipeline: the gate. A red job drops the car (Landing an MR (the merge train is the merge gate) § A dropped car).

  • The MR’s own pipeline: the car blocks there too when code changed; fix it before adding the car.

  • main’s post-merge pipeline: no car (the train ran it on the same tree), `feature-matrix and cargo-deny on their inputs' change, keyed secrets-policy, pages, and by hand release-build, pentest and perf-load.

  • Scheduled pipelines: policy-drift names its owner and SLA in its job comment (every signal acked or fixed by the next scheduled run). Idle issues, draft MRs and branches are read from GitLab’s own filtered views (Stale Work Policy); no job looks for them.

Resuming a stale single-commit branch (2026-06-06 lesson)

When resuming feature work whose branch was authored weeks ago and never pushed (e.g., a paused per-partner crate sitting on a single commit off a stale parent), the rebase path works cleanly when the branch carries exactly one commit:

  1. git branch --contains <sha> confirms which branch holds the commit.

  2. git log <sha>^ -1 shows the parent — verify it’s reachable from current main (git merge-base main <sha> should return the parent or an earlier commit).

  3. git rebase --onto main <parent-sha> replays the single commit on top of current main.

  4. Conflicts will land in Cargo.toml (workspace members + [workspace.dependencies] — usually trivial; keep both sides) and, for a branch from before the v0.2.0 cut, CHANGELOG.adoc (its == Unreleased now holds only the pointer: move the branch’s bullet to a changelog.d/ fragment, README there, and keep main’s side).

  5. After conflict resolution: cargo fmt --all + cargo clippy --workspace --all-targets — -D warnings + cargo nextest run --workspace.

  6. If the branch carries pre-Plan-M lint discipline (transitional #![allow(clippy::pedantic | clippy::cargo)] at lib root), the cargo xtask validate lint-regime check will reject the push: R5 fails a group suppression and every other inner allow must be registered (Quality Gates & Enforcement (CRAIG) § Lint regimes). Apply the lift per Quality Gates & Enforcement (CRAIG) (§ Resuming pre-Plan-M crate authoring) as a follow-up commit on the same branch (never amend the original commit per the git-workflow standard).

For untracked working-tree work (no commit, just files sitting in crates/<name>/), branch off current main and git add the files directly — no rebase needed. Apply the same lint-discipline check before pushing. The lint-regime check will fire if the lib root retains the pre-Plan-M block.

Branch hygiene (CRAIG-specific cadence)

  • Wait for main before branching: when an MR is in flight, let its merge land (Landing an MR (the merge train is the merge gate)), then git checkout main && git pull --ff-only origin main, then branch. Branching from local main while an MR is mid-merge produces Cargo.toml rebase conflicts that have to be untangled manually.

  • Branch cleanup after each merge (not at session end). After every merge, run:

    git branch --merged main | grep -v '^\*\| main$' | xargs -r git branch -d
    git remote prune origin

    Keeps the local branch list and origin/refs aligned with what’s actually on the remote.

Don’t pre-source .ports.env before a local battery

cargo xtask e2e refreshes the devstack, reassigning random host ports and rewriting .ports.env. If you have pre-sourced .ports.env into your shell, the stale ambient CRAIG_TEST__* variables point at dead ports; a later step of a local cargo xtask validate reads them over the fresh file and fails with dead-port connection errors that masquerade as a security or perf-scan failure but are really a port race. The pre-push hook starts no devstack, so a push is not affected.

Run the battery in a clean environment — verify with env | grep -c CRAIG_TEST__ returning 0 and let each xtask step load .ports.env itself. (Sourcing .ports.env is still correct for a bare cargo nextest run --run-ignored all, which does not auto-load it; the sanctioned local run is cargo xtask test --package <crate> --integration, #1802.)

cargo deny goes red repo-wide on a new RUSTSEC advisory

The cargo-deny CI job runs cargo deny check on a merge request or a main commit that touches a manifest, Cargo.lock or deny.toml, and on every scheduled pipeline (the pre-push hook and validate do not run it, #1402). So a new RUSTSEC advisory against any dependency in the tree turns the job red on the next schedule and on every later dependency change, whatever that change was. This is not a defect in your work.

Fix it in a dedicated fix(deps) MR, not inline in an unrelated branch: cargo update -p <crate> to the patched within-semver release on its own branch, land it, then git rebase origin/main your in-flight branch onto it (release notes are separate changelog.d/ fragments, so the two branches' notes do not conflict). cargo deny check standalone confirms the fix before pushing. This recurs regularly (e.g. anyhow, ammonia).

Pre-push battery SIGTERM’d mid-run — single occurrence, monitor-only (#1486)

One battery run (2026-08-17) died to an externally-delivered signal: 15, SIGTERM mid-suite with no identifiable sender — the failure reads like a mystery kill, so record the diagnosis here rather than re-deriving it. Disposition (2026-08-18, on-issue): the transport-idle hypothesis does NOT map onto the HTTPS smart transport (discrete GET/POST requests, no held connection to idle out), and the trigger environment — triple-load parallel worktree batteries — was structurally retired with the shared cargo-target. Downgraded to P4 monitor-only; #1486 stays OPEN as the recurrence tracker.

On recurrence: run the instrumented-repro recipe on #1486 (process-tree watcher capturing the killer PID) before any remediation — do not blame the environment or restart blindly; a single kill with an unidentified sender is not yet a diagnosis.

Externally-blocked stakeholder-filed issues

CRAIG receives compliance and integration issues filed by agency stakeholders that look immediately actionable but actually depend on external teams or external-system coordination (e.g. SHINES → Gateway integration owned by the OGG GGUPM team, or SSA exchange agreements for IV-E data). These are not CRAIG dev-team code tasks: the implementation spans multiple teams/systems, so building the CRAIG half of an integration that can’t be exercised end-to-end burns cycles.

How to disposition: mark such issues externally-blocked and skip them from the immediate-action backlog until the external dependency clears — treat them like other externally-owned work rather than "ready to pick up next."

Signals that an issue is externally-blocked:

  • Body references to external coordination — "OGG CR", "Gateway", "external integration", an external CR URL, or a named legacy system (SHINES, SACWIS, IES, etc.) without a clear statement of which side CRAIG owns.

  • Author + shape — filed by a named agency stakeholder (not the bot) with empty or stub acceptance criteria.

Partial actionability via the mock server: where the CRAIG-side scope is well-defined and exercisable against the devstack’s mock server (which stands in for a jurisdiction’s external systems through the simulators of its configuration layer), the adapter can be built and tested in the jurisdiction’s configuration repository without external-team coordination — only production cutover needs the external work. Default disposition stays externally-blocked; surface the mock-actionable interpretation only when explicitly directed.

Lessons Learned

  • Nextest parallelism: Default thread count equals logical CPUs (32 on dev machine). This overwhelms Docker devstack with concurrent HTTP connections, causing random 30s reqwest timeouts. Fixed by setting test-threads = 16 (physical cores) in .config/nextest.toml on 2026-03-09, then cut back to 8 on 2026-03-22 for pre-push timeouts, where every profile stays. Every host runs that 8 (local-dev § Battery threads and the nextest environment).

  • Docker image tags: Query registry API, don’t guess: curl -s "https://registry.hub.docker.com/v2/repositories/{owner}/{image}/tags/…​"

  • Keycloak 26+ hostname v2: KC_HOSTNAME_PORT is silently ignored; KC_HOSTNAME must be a full URL (e.g., http://host.docker.internal:8180).

  • curl -sf + -w '%{http_code}': -f causes status code concatenation. Use -s without -f, with || true for fallback.

Edit this page · latest