CI determinism gate can pass after offline build returns failure

Open
#157 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
55/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, github-actions, python
Domain
ci-cd

Research direction

The defect is in the 'Determinism check on the example observations' step of .github/workflows/ci.yml, where two devostasis build ... | head -n 1 | awk pipelines capture bundle IDs under the default bash -e shell. Start by reading that step and the post-commit path in cmd_build in src/devostasis/cli.py. Done means a build that exits 1 after printing its ID makes the step fail before verify runs, while matching IDs with successful builds still pass; a shell harness with stub commands can check both.

Written by the indexing model from the issue text.

Description

Confirmed CI false-success path (release 0.6 candidate, 2026-11-24)

Pinned source: release/0.6.0@6d935ee111e2efab7a5f7d7c8f8d050af8d35567, .github/workflows/ci.yml blob 2fcc7c9843e2c9ca1a66203063845f9f6b7bac45; unmerged #81 synthetic merge tree 55f55490206ee599c5f298d79c3c2bb37c948b50, same step in workflow blob f89a12de173d0846ae9f2844bb793024758133f7. src/devostasis/cli.py on the latter tree is blob 6b6cea03a4ddf3317229e47c5c14497fec31f96d.

Determinism check on the example observations captures each build's first line through devostasis build ... | head -n 1 | awk '{print $2}'. Neither workflow nor step declares a shell override. GitHub documents that the unspecified Linux shell runs bash -e, without pipefail (https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-syntax#jobsjob_idstepsshell). An error in the build process can therefore be masked by a successful awk. This is a real reachable CLI failure shape: cmd_build prints the bundle ID after store.commit(bundle), then writes an execution receipt and calls write_fleet_index(store). A HistoryStoreError from the latter prints 'the bundle is committed, the fleet surfaces are not' and returns 1. Since the bundle is already committed, subsequent verify of store-a can succeed. A failed build must not count as a successful determinism check. Also test -n "$a" && test "$a" = "$b" does not terminate bash -e when the first test fails, because it is the non-final command of an AND list.

Proposed minimal workflow correction

Keep the existing two build commands and all flags, but remove the early-closing pipelines and isolate each command's status. Replace the two ID assignments and combined test with:

out_a=$(devostasis build --observations examples/observations.json --store /tmp/store-a --planning milestones --debt-label type:refactor --debt-mapping-version example-1)
out_b=$(devostasis build --observations examples/observations.json --store /tmp/store-b --planning milestones --debt-label type:refactor --debt-mapping-version example-1)
a=$(awk 'NR == 1 {print $2}' <<< "$out_a")
b=$(awk 'NR == 1 {print $2}' <<< "$out_b")
echo "bundle ids: $a $b"
test -n "$a"
test "$a" = "$b"
devostasis verify --bundle /tmp/store-a/projects/github.com/acme/widget/latest

This preserves the existing comparison semantics and verification command. It is deliberately narrower than changing all workflow shell settings or the runtime/contract. No new dependency or semantic version change.

Executed verification

Local bash -e subprocess harness with a stub devostasis that emits the same first-line ID and subsequent bands output, optionally exits 1 after printing (simulating the explicit real CLI post-commit failure), and has a successful verify control. Used abbreviated arguments for the stub, preserving the actual original and replacement shell constructs. 12 executions, 6/6 paired expectations matched:

Scenario Original exit Candidate exit
Both builds successful, same ID 0 0
Only second build returns 1 after printing ID 0 1
Only first build returns 1 after printing ID 0 1
Both builds return 1 after printing ID 0 1
Different IDs 1 1
Successful commands with empty stdout, verify stub succeeds 0 1

This is shell-level evidence, not a real package run or an observed hosted false green. The exact #81 upstream workflow runs 39617246533/39617244278 currently report failure with zero jobs; this defect is NOT asserted to be their cause. Full pytest, real offline builds, conformance, wheel and fixing-head hosted CI are NOT_RUN.

Acceptance
  • Implement on a focused branch targeting release/0.6.0, retain the exact-head checks and existing determinism verification.
  • Add an executable shell regression using the actual workflow step (stub first/second post-output failure, empty output, differing IDs, success). At least the post-output error must make the step fail before verification.
  • Run the real successful offline build and bundle verification checks and full release CI at the new head.
  • Distinct from #128 (concurrency), #124 (timeouts), #122/#156 (wheel) and #24 (publisher). Open/closed searches for pipefail, determinism step, first-line capture and fleet-surface failure found no dedicated issue. No research decision required.

Authenticated andy-zen-dev: pull=true, push=false, triage=false, maintain=false, admin=false. No upstream code commit or merge made.

Dominant language
Python
Stars
6
Forks
1
Avg merge
6m
Merged PRs (30d)
1

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from drevendev/Devostasis

All issues in drevendev/Devostasis

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.