49 lines
2.7 KiB
Markdown
49 lines
2.7 KiB
Markdown
# Native Library Upgrade Review Remediation
|
||
|
||
Reviewed implementation Stages 1–12 at commit
|
||
`23af6579c31db32addb940005292de179ecee1d0` against the
|
||
[implementation plan](implementation.md) and [feature roadmap](library-upgrades.md).
|
||
|
||
## Isolate Secrets Bootstrap In The Maintained-Example Test
|
||
|
||
**Status: Complete.** The sweep now registers `t.Setenv` cleanup before
|
||
unsetting the synthetic variable, exercising provisioning from absence while
|
||
restoring the original presence and value after the test. Production bootstrap
|
||
and comparison behavior are unchanged.
|
||
|
||
Verification passed: a temporary test overlay failed before the fix and now
|
||
passes for initially absent and pre-existing values, including three repeated
|
||
race runs. Maintained-example/bootstrap tests passed five shuffled race runs;
|
||
the full normal and race suites, vet, build, formatting, and whitespace checks
|
||
also passed.
|
||
|
||
**Location:** `internal/adapter/cli/examples_test.go:20–30`, reached through
|
||
`examples/config.secrets.yml` and its synthetic secrets directory.
|
||
|
||
The maintained-example sweep automatically selects every `config*.yml` file,
|
||
including the newly added secrets example. Both scope validations invoke native
|
||
bootstrap in the test process. When `SCRIPTORIUM_EXAMPLE_TOKEN` is initially
|
||
absent, the first acquisition sets it and the second sees that existing value.
|
||
The sweep does not register environment cleanup, so the variable remains set
|
||
after the test finishes. Its behavior therefore depends on inherited process
|
||
state and leaves bootstrap state for later tests.
|
||
|
||
This was reproduced without modifying repository code: a temporary Go test
|
||
overlay ran the existing sweep as a subtest with the variable initially absent,
|
||
then confirmed it remained present after the subtest and its cleanup returned.
|
||
The separate `TestMaintainedSecretsExample` controls its own environment, but
|
||
that cleanup does not cover the sweep.
|
||
|
||
Stages 2 and 5 and the [testing policy](../policy/testing.md#test-execution-requirements)
|
||
require controlled, restored test environment state. Control the synthetic
|
||
variable in the sweep with `t.Setenv` so cleanup restores its original presence
|
||
and value. If testing actual provisioning from absence, register that cleanup
|
||
before unsetting the variable and invoking the example. Keep this change local
|
||
to the test harness: production acquisitions and comparison sides retain native
|
||
process-environment effects without rollback.
|
||
|
||
**Verification:** run the maintained-example and bootstrap tests repeatedly and
|
||
with shuffled ordering. Confirm the sweep restores an initially absent variable
|
||
and a pre-existing value when its cleanup finishes. Reuse native bootstrap
|
||
coverage rather than adding another secret-file parser or parsing matrix.
|