Skip to content

ci: temporary Git fixtures inherit environment-scoped commit signing #3485

Closed

Description

@schlessera

Context

Found while auditing #3060 on main d142e997b6fdc2f74d46fcf3c42a6aeaccebc519. Many temporary-repository fixtures are isolated from ambient file configuration only. They write repository-local commit.gpgsign false (identify, packages/core/tests/sync-fixture.ts:39-43) or set GIT_CONFIG_GLOBAL=/dev/null while forwarding process.env. Environment-scoped configuration (GIT_CONFIG_COUNT / GIT_CONFIG_KEY_n / GIT_CONFIG_VALUE_n) outranks both repository-local and global config, and these fixtures still inherit it.

#3060's Verification section uses exactly this env-scoped method. With GIT_CONFIG_COUNT=2, commit.gpgsign=true and gpg.program=fixture-missing-signer in the test command, 37 test files fail fixture or product commits with cannot run fixture-missing-signer. The same 37 files pass under an ambient global config with the same signing settings (GIT_CONFIG_GLOBAL pointing at a scratch file):

  • core: cache-location, cache-merge, cli-contract, cli-onboarding, media-review-contract, storage-inventory, storage-pack, and every sync-* suite (sync-artifacts, sync-cache-commit, sync-commit, sync-pending-state, sync-pull-rebase, sync-run, sync-runtime, sync-scenarios, sync-stash, sync-stats-history, sync-verbs)
  • module-jobs: board-selection-runtime
  • ui-react: scratch-links-runtime
  • ui-server: jobs-board-selection-http, maintenance-startup-view, module-settings-http, provider-mask-bridge, storage-maintenance-owners, storage-removal-worker
  • root: inclusion-inputs, native-diagram-inputs, proof-reuse, proof-system, search-result-tags-adapters

The heaviest helpers are git/identify in packages/core/tests/sync-fixture.ts:28-43 (fixture commit at :94) and the proof-input fixtures behind tests/proof-system.test.ts.

No real failure of this kind has been observed: the release-proof failures in #3060 came from ambient global configuration, which #3117 and the #3060 audit PR cover. This issue covers the remaining env-scoped channel, so that #3060's own verification method holds tree-wide.

Out of scope

Product signing behaviour (product commits must keep honouring a user's configuration), global or developer Git configuration, the shared test harness (keylessEnv and the test preload's GIT_CONFIG_COUNT maintenance entries in scripts/test-network-guard.ts), and unrelated fixtures.

Scope

Make the listed fixtures' temporary repositories independent of env-scoped signing configuration. Fixture-only commits can take command-scoped -c commit.gpgsign=false. Fixtures whose product commands commit (sync, settings, onboarding) need their Git and CLI children to carry command-scoped overrides. The withoutSigning(env) helper from the #3060 audit (packages/core/tests/git-fixture.ts) appends them to GIT_CONFIG_COUNT. Apply those overrides in the affected fixtures and their fixture-specific helpers. Reuse withoutSigning where product commands commit; use command-scoped Git overrides for fixture-only commits. Do not change keylessEnv or install a blanket preload/harness override. In particular, packages/core/tests/hygiene.test.ts and packages/core/tests/tags.test.ts deliberately enable repository-local signing and must continue to exercise it.

Acceptance criteria

  • Isolation is fixture-local, reuses the existing helper where applicable, and leaves the shared harness, product signing behavior and developer configuration unchanged. Audit every listed fixture and every committing child it launches.
  • Every listed file passes through bun run test with command-scoped GIT_CONFIG_COUNT=2, commit.gpgsign=true, gpg.program=fixture-missing-signer.
  • The same files still pass with a scratch global config enabling the same signing settings, and with no signing configuration.
  • Existing behavioural assertions and expect counts are unchanged; tests that deliberately enable signing keep doing so.
  • Removing the new isolation reproduces the missing-signer failures (mutation receipt).

Verification

Run the listed files under the env-scoped method before and after, record pass/fail counts and the diagnostic count, and run a removal mutation. Keep the offline test guard.

Contract impact

None: test fixture isolation only.

Maintainer decision — 2026-11-08

Use fixture-local overrides, reusing the existing helper only in affected fixtures. This limits side effects and preserves tests that intentionally exercise signing; auditing every listed fixture is part of the implementation. The shared-harness alternative is not selected.

Bounded reproduction — 2026-11-04

At inspected main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36, ran:

env GIT_CONFIG_COUNT=2 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=true GIT_CONFIG_KEY_1=gpg.program GIT_CONFIG_VALUE_1=fixture-missing-signer bun run test packages/core/tests/sync-runtime.test.ts

All eight selected cases failed during real fixture Git commits; the named diagnostic is cannot run fixture-missing-signer / gpg failed to sign the data, through git and brainWithRemote in sync-fixture.ts. The tests loaded and executed; this is the env-scoped signing reproduction, not a module-load failure or a new production incident. No fixture or product source was changed. The broader 37-file and global-config controls remain implementation verification, not newly executed results.

2026-11-04 triage at main 53b862123d7b8e4c9d039859fabdc9fc6ad4cd36: Added the explicit fixture-local versus shared-harness question and a bounded matching signing failure; preserved the existing p3 deferral and decision label. No new runtime qualification or implementation is claimed.

2026-11-08 decision reconciliation: folded the maintainer's fixture-local ruling into scope, exclusions and acceptance criteria. The earlier unresolved-scope notes are historical; no implementation or new test result is claimed.

Implementation verification handoff — 2026-11-15

Draft repair: #4075, head be66700430f3269a8a21668399fa1c7afb0db711. The current named/wildcard inventory contains 42 files. Existing test-health corrections are retained; this repair covers the ten remaining core files and three ui-server files, with fixture-local opt-in hooks reusing withoutSigning and a command-scoped override for the remaining fixture-only Git helper. The shared harness and product signing policy are unchanged.

Failing first: 145 missing-signer failures in the ten core files, plus four reproduced separately in the three ui-server files. Removing the new opt-in from an otherwise identical sync-runtime suite reproduces all eight missing-signer setup failures; the restored suite passes all eight. The restored suite and unchanged hygiene/tags signing-policy suites pass together: 127 tests / 814 assertions.

All 42 files were run under environment-scoped signing, scratch-global signing and no signing configuration. Every control has exactly 624 pass / 40 fail / 66,850 assertions, the same 40 failing test names, and zero missing-signer diagnostics; all 531 core cases pass. The remaining failures are host-dependent native-worker/HTTP verification, including refused UID-map writes, and are not claimed green. CI-pinned Bun 1.4.2 and the documented independent install recovery qualify the frozen native installation control. Lint, strict types and check:pr pass (495 fast invariants / 3,620 assertions).

Post-PR collision detection at the repair head reports 35 shared-closure overlaps and no textual, path or unknown collision. Both issue and PR retain milestone 0.45.0; claim claim-fd1ab594 remains held.

2026-11-16 verification completion: heavy-feedback run 43797929013, attempt 1, passed every selected job on actual checkout be66700430f3269a8a21668399fa1c7afb0db711, with recorded base cc326cc64348a765325adc1cbe74248d60844845. The logs include all 42 audited files and the supported-host native-worker/HTTP and Chrome paths that could not complete locally. The PR body records the admission identity, selected job IDs and checkout evidence. The historical local failures remain recorded at their actual results.

The unchanged-head local receipt remains passing; refreshed collision detection reports 28 shared-closure overlaps and no textual, path or unknown collision. Both milestones remain 0.45.0, the worktree is clean, and claim claim-fd1ab594 remains held. PR #4075 now uses Closes. READY-TO-LAND: the orchestrator owns candidate confirmation and landing; no new heavy run or confirmation was requested.

Activity

  1. added
    type: test
    area: core
    area: ci
    priority: p3
    needs: decision
    on Nov 3, 2026
  2. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-08): Use fixture-local signing overrides, reusing the existing helper only in affected fixtures. Do not change the shared test harness or blanket-disable signing.

    Audit all listed fixtures, including Git/CLI child processes that commit. Preserve tests that deliberately enable signing and preserve product/developer signing configuration. The body now selects this branch and retains the environment/global/no-signing controls and mutation proof as implementation requirements. With no other needs: label, this issue is agent-ready.

  3. added
    agent-ready
    and removed
    needs: decision
    on Nov 8, 2026
  4. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Test-health audit of packages/ui-server/tests/maintenance-startup-view.test.ts (one of the listed ui-server files), at 0129244ad0781c426f7d3f2363c92d8993aefaee (main plus the test-health epic branch), Linux 6.18 WSL2:

    • env GIT_CONFIG_COUNT=2 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=true GIT_CONFIG_KEY_1=gpg.program GIT_CONFIG_VALUE_1=fixture-missing-signer bun run test packages/ui-server/tests/maintenance-startup-view.test.ts: exit 0, 28 pass, 0 fail, no fixture-missing-signer diagnostic.
    • Positive control, same command and environment on packages/core/tests/sync-runtime.test.ts: exit 1, 0 pass, 8 fail, 8 fixture-missing-signer diagnostics. The env-scoped method still reaches the test processes on this machine.

    The file's Git use is init, config, add, show and check-attr; it makes no fixture commit of its own. At this commit it does not reproduce the missing-signer failure. No test changed. The other listed files are unaffected by this check.

  5. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Test-health push (epic #3855), batch e3855-core-02, run th-20261110163724-c232a4#6: packages/core/tests/sync-pending-state.test.ts only.

    • Reproduced with the issue's env-scoped method (GIT_CONFIG_COUNT=2, commit.gpgsign=true, gpg.program=fixture-missing-signer): 0 pass / 29 fail, 29 fixture-missing-signer diagnostics.
    • Fix (fixture-local, reuses withoutSigning from packages/core/tests/git-fixture.ts): a beforeEach appends the no-signing entries to process.env and an afterEach restores the previous GIT_CONFIG_* values. That covers the fixture's own git calls, the in-process conclude/pendingState git children, and the runCli children (which forward process.env). No shared harness change.
    • After: env-scoped method 29 pass / 0 fail; scratch GIT_CONFIG_GLOBAL with the same signing settings 29 pass; no signing config: 10 shuffled runs, 0 failures.
    • Mutation: removing the withoutSigning call, run under the env-scoped method, fails a clean repository has nothing pending and nothing to conclude on fixture-missing-signer and passes once restored (killed).

    The other listed files are not covered by this change, so the batch PR will say Refs #3485.

  6. added this to the 0.45.0 milestone on Nov 10, 2026
  7. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Test-health push (#3855), shard e3855-root-02, on base 0129244ad. Covers the five root files this issue lists.

    Reproduced. Each file ran through bun run test with env-scoped signing (GIT_CONFIG_COUNT=2, commit.gpgsign=true, gpg.program=fixture-missing-signer):

    File Before After
    tests/inclusion-inputs.test.ts 0 pass / 11 fail 11 pass
    tests/proof-reuse.test.ts 3 pass / 12 fail 15 pass
    tests/proof-system.test.ts 3 pass / 18 fail 21 pass
    tests/native-diagram-inputs.test.ts 11 pass unchanged: it makes no fixture commit
    tests/search-result-tags-adapters.test.ts 6 pass unchanged: passes under the same environment

    Cause. The three failing fixtures disable signing in repository-local config (git config commit.gpgsign false) or not at all. Environment-scoped configuration outranks repository-local config, so their fixture-only commit and commit-tree calls tried to sign.

    Change (test code only). Command-scoped -c commit.gpgsign=false, which outranks the environment, on the fixture commits in inclusion-inputs and proof-reuse, and in proof-system's fixture Git helper. No product command commits in these fixtures, so withoutSigning is not needed. keylessEnv and the shared harness are untouched.

    Proof. After the change, measure --runs 5 --shuffle under the same signing environment gives 10/10 clean runs for each of the three files. Their plain baselines are unchanged. before-signing-*.json holds the failing receipts on the unchanged base.

    Still open. This covers only the root files. The core, module-jobs, ui-react and ui-server files listed in the body are not in this shard. The batch PR says Refs, not Closes.

  8. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Test-health push (epic #3855), batch e3855-ui-server-04, run th-20261110174252-07efe9#3: packages/ui-server/tests/storage-removal-worker.test.ts only, at 0129244ad0781c426f7d3f2363c92d8993aefaee, Linux 6.18 WSL2.

    • env GIT_CONFIG_COUNT=2 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=true GIT_CONFIG_KEY_1=gpg.program GIT_CONFIG_VALUE_1=fixture-missing-signer bun run test packages/ui-server/tests/storage-removal-worker.test.ts: exit 0, 1 pass, 0 fail, no fixture-missing-signer diagnostic.
    • Positive control, same command and environment on packages/core/tests/sync-runtime.test.ts: exit 1, 0 pass, 8 fail, 8 fixture-missing-signer diagnostics, so the env-scoped method reaches test processes on this machine.

    The file's own Git use is init and add (packages/ui-server/tests/storage-removal-worker.test.ts:18-19, with GIT_CONFIG_GLOBAL=/dev/null and GIT_CONFIG_NOSYSTEM=1); it makes no fixture commit, and the review it drives runs Git read-only in a disposable worker. It does not reproduce the missing-signer failure. No test changed; the batch PR will say Refs #3485.

  9. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Test-health push (epic #3855), batch e3855-ui-react-06, run th-20261110183038-0543ec#1: packages/ui-react/tests/scratch-links-runtime.test.ts only, at a0aaece34a96ed02a32dd02dcf14ec093e170b59 (the test-health epic branch), Linux 6.18 WSL2.

    • env GIT_CONFIG_COUNT=2 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=true GIT_CONFIG_KEY_1=gpg.program GIT_CONFIG_VALUE_1=fixture-missing-signer bun run test packages/ui-react/tests/scratch-links-runtime.test.ts: exit 0, 19 pass, 0 fail, no fixture-missing-signer diagnostic (real Chrome present, so the suite ran rather than skipped).
    • Positive control, same command and environment on packages/core/tests/sync-runtime.test.ts: exit 1, 0 pass, 8 fail, 8 fixture-missing-signer diagnostics, so the env-scoped method reaches test processes on this machine.

    The fixture builds its brain with createFixtureBrain (files and a symlink, no git init) and its only Git use is the git binary linked into the render PATH; the real brain render --scratch path it drives makes no commit. At this commit it does not reproduce the missing-signer failure. No test changed; the batch PR will say Refs #3485.

  10. schlessera commented on Nov 10, 2026

    @schlessera
    OwnerAuthor

    Test-health push (epic #3855), batch e3855-module-jobs-01, run th-20261110201428-8c4366#0: packages/module-jobs/tests/board-selection-runtime.test.ts only, on the epic branch at b71c6e4fe, Linux 6.18 WSL2.

    • Reproduced. env GIT_CONFIG_COUNT=2 GIT_CONFIG_KEY_0=commit.gpgsign GIT_CONFIG_VALUE_0=true GIT_CONFIG_KEY_1=gpg.program GIT_CONFIG_VALUE_1=fixture-missing-signer bun run test packages/module-jobs/tests/board-selection-runtime.test.ts: 13 pass / 3 fail, fixture-missing-signer in each failure. The failing cases are the two shared writer and hand-edited loader ... cases and saving an intentional empty selection ...: the fixture's own commit, and brain module settings --set committing through the shared writer.
    • Cause. The fixture disabled signing in repository-local config (git config commit.gpgsign false), which environment-scoped config outranks, and the CLI children forwarded the environment unchanged.
    • Change (test code only). The file wraps keylessEnv and runCli with withoutSigning from packages/core/tests/git-fixture.ts, as packages/module-jobs/tests/settings.test.ts already does, so the fixture's Git calls, the runCli children and the spawned jobs scrape/validate children all carry command-scoped no-signing entries. keylessEnv and the shared harness are untouched.
    • After. measure --runs 5 --shuffle under the same signing environment: 10 of 10 runs clean. The plain baseline and after-measure are stable.
    • Mutation. Removing the withoutSigning wrapper, run under the env-scoped method, fails saving an intentional empty selection uses the shared writer and preserves TypeScript on fixture-missing-signer and passes once restored (killed).

    This covers the module-jobs file in the list only. The batch PR says Refs #3485.

  11. self-assigned this
    on Nov 15, 2026
  12. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Claimed for implementation. Claim token: claim-fd1ab594. Branch: test/3485-env-signing.

    Prior signing fixes #3117 and #3486 are merged; reusing withoutSigning. Collision details checked before implementation.

  13. schlessera commented on Nov 15, 2026

    @schlessera
    OwnerAuthor

    Implementation and local verification are preserved in draft #4075 at be66700430f3269a8a21668399fa1c7afb0db711. The body now records the failing-first/mutation receipts, three identical configuration controls (zero missing-signer diagnostics), passing local preflight, and the remaining native-runtime verification gap. No shared harness or product signing policy changed.

    Heavy feedback could not be dispatched: GitHub returned HTTP 403 because the shared API rate limit is exhausted. Resume by running bun scripts/request-heavy-feedback.ts 4075 after reset, then qualifying the runtime results. Claim remains held for the orchestrator; no confirmation or merge was requested.

  14. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Merged in #4075 as 78e326c80 through the integration lease (orchestrator merge queue for 0.45.0). Candidate confirmation passed on the exact head; the squash's own main run carries the post-merge heavy categories.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ciarea: corepriority: p3type: test

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions