Fix: Close verification gate review findings
This commit is contained in:
@@ -242,7 +242,7 @@ contract_manifest_entries() {
|
||||
}
|
||||
```
|
||||
|
||||
Do not make a missing manifest mean “everything is safe.” `cmd_test` and `cmd_contracts` must fail clearly if the file cannot be read. The manifest contract owns deeper format validation; the CLI owns the runtime read failure.
|
||||
Do not make a missing or malformed manifest mean “everything is safe.” Before either `cmd_test` or `cmd_contracts` consumes manifest entries, the public CLI independently validates the complete actual manifest: exactly two fields, known/non-empty/non-duplicate capabilities, exclusive `hermetic`, unique sorted paths, the executable/`*_test.py` fixture-excluded discovery set, and a non-empty directly preceding comment for every non-hermetic entry. Missing discovered contracts and stale manifest paths are fatal before selection or execution. Keep `tests/setup/contract-manifest-contract` as an independent validator rather than sourcing runtime code; a later contract cannot protect earlier execution.
|
||||
|
||||
### Step 3: Implement argument and capability policy
|
||||
|
||||
@@ -271,7 +271,7 @@ local timeout_seconds="${PANAMA_TEST_TIMEOUT_SECONDS:-180}"
|
||||
}
|
||||
```
|
||||
|
||||
Run the implementation body in a subshell, create one capture directory with `mktemp -d`, and trap its removal on `EXIT`, `INT`, and `TERM` inside that subshell. This keeps cleanup reliable without leaking or overwriting traps in the parent CLI process. For each contract, run either `python3 path` or the executable through:
|
||||
The public CLI process must own contract supervision. Check that `mktemp -d` succeeds before constructing any capture path, then install top-level `EXIT`, `INT`, and `TERM` cleanup around the checked directory. Launch the active `timeout` asynchronously and retain its PID/process-group ownership. On INT or TERM sent to the exact CLI PID, signal the active timeout/process group, wait for it, remove capture storage, and exit 130 or 143. On normal completion, remove capture storage and clear the temporary traps without changing the aggregate test status. For each contract, run either `python3 path` or the executable through:
|
||||
|
||||
```bash
|
||||
timeout --signal=TERM --kill-after=5 "$timeout_seconds" \
|
||||
@@ -389,8 +389,10 @@ The leaked fixture must include:
|
||||
|
||||
- a literal YAML credential `POSTGRES_PASSWORD: fixture-should-be-rejected`;
|
||||
- a literal env credential `API_TOKEN=fixture-should-be-rejected`.
|
||||
- a plain-text PEM private-key header with an exact `path:line: private key` finding;
|
||||
- plain-text synthetic `sk-ant-`, minimum-supported-length `ghp_`, and `xoxb-` signatures, each with an exact `path:line: provider token` finding.
|
||||
|
||||
Use intentionally invalid fixture strings, not realistic provider token formats.
|
||||
Add clean plain-text near-misses for each signature. Keep semantic fixture credentials intentionally invalid and signature fixtures clearly synthetic while still matching the supported signature shapes.
|
||||
|
||||
### Step 2: Write the scanner with only the Python standard library
|
||||
|
||||
|
||||
Reference in New Issue
Block a user