Skip to content

chore(v0.3): closing audit fixes + items 18-20#46

Merged
TechAlchemistX merged 1 commit intomainfrom
chore/v0.3-closing-audit
Apr 19, 2026
Merged

chore(v0.3): closing audit fixes + items 18-20#46
TechAlchemistX merged 1 commit intomainfrom
chore/v0.3-closing-audit

Conversation

@TechAlchemistX
Copy link
Copy Markdown
Owner

Summary

Final pre-v0.3.0-tag pass. Three reviewer subagents (code / security / rust) audited the full v0.3 scope; release verdict: GREEN. This PR lands the surfaced fixes + the three deferred rust-engineer refinements.

Audit-surfaced fixes

  • [High/code] Azure vault-URL regex bug: accepted 1-char vault names, rejected 2-char. Azure's rule is 3-24. Flipped to required middle+last quantifier; added boundary tests.
  • [Medium/sec] Drift-catch assertion tautology: msg.contains("azure") always true in azure errors. Tightened to msg.contains("strict-mock-no-match") only; .unwrap_err() remains the load-bearing lock. Applied to gcp + azure.
  • [Medium/code] Fragment errors missing docs/fragment-vocabulary.md link. Added to gcp + azure resolve_version + test assertions.
  • [Medium/code] gcp missing CV-1 drift-catch analog: added set_drift_catch_rejects_data_flag_on_argv.
  • [Medium/code] No direct check_extensive test in gcp or azure. Added one per backend.

Items 18-20 (deferred rust-engineer refinements)

  • Item 18strict::Rule { argv, response: Response } unification (internal; private struct).
  • Item 19BackendUri::fragment_directives returns IndexMap<String, String> (preserves URI-written order, drops sort_unstable noise). Pre-launch breaking change; install base zero.
  • Item 20Response::with_stdin_fragment(impl Into<String>) chainable. Additive.

Deferred post-v0.3.0

Per audit triage: gcp cert-bound comment (hygiene), azure tenant/sub factory validation (low value), azure_vault_url dead-code removal (kept for Level-3), deny.toml AGPL exception-tightening (supply-chain follow-up).

Test plan

  • cargo fmt --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --workspace — 435 → 442 (+7: 3 azure regex boundary + 2 check_extensive + 1 gcp data-flag drift-catch + 1 delta)
  • cargo deny check
  • cargo audit
  • CI green
  • Re-verify integration smoke still 250/250 against live backends (prod-code changes are regex-fix + error-message-wording + IndexMap signature; no runtime-behavior regressions expected)

🤖 Generated with Claude Code

Three reviewer subagents (code / security / rust) audited the
full v0.3 scope (Phase 0 + Phase 1 gcp + Phase 2 azure + licensing).
Release-verdict: GREEN. This patch lands the surfaced fixes plus
the three deferred rust-engineer refinements.

Audit-surfaced fixes:

- **Azure vault-URL regex BUG**: accepted 1-char vault names, rejected
  2-char. Original inner group `([a-zA-Z0-9-]{1,22}[a-zA-Z0-9])?` was
  optional so a 1-char name matched the leading `[a-zA-Z0-9]` alone.
  Azure's actual rule is 3-24 chars. Flipped to require middle+last
  (min 3, max 24). Added boundary tests.
- **Drift-catch assertion tautology** (security): `msg.contains("strict-
  mock-no-match") || msg.contains("azure")` was always-true because
  every azure error begins with `azure backend '…':`. Same for gcp.
  Tightened to `msg.contains("strict-mock-no-match")` only. The outer
  `unwrap_err()` remains the load-bearing regression lock.
- **Missing `docs/fragment-vocabulary.md` link** in gcp + azure
  unsupported-directive errors. Aligned with the aws-secrets shorthand
  error shape and the fragment-vocabulary doc registry. Tests extended
  with the link-assertion.
- **gcp missing CV-1 drift-catch analog**: azure has both `--value`-leak
  and missing-`--encoding-utf-8` positive locks; gcp only had the
  secret-on-stdin check. Added `set_drift_catch_rejects_data_flag_on_argv`
  — declares the buggy `--data=<secret>` argv form so regressions
  emitting the secret on argv surface exit 97.
- **No `check_extensive` direct test** in gcp or azure — trait-default
  behavior silent-inherited with no regression lock. Added one per
  backend.

Items 18-20 (rust-engineer deferred refinements):

- **Item 18 — `strict::Rule` unification.** `Rule` used to flatten every
  `Response` field; now `Rule { argv, response: Response }`. One struct
  move in `on()` instead of seven field moves. Private struct → no API
  break.
- **Item 19 — `HashMap`→`IndexMap` in `BackendUri::fragment_directives`.**
  Insertion order deterministic = URI-written order. `indexmap` was
  already a workspace dep. `remove` → `shift_remove` per IndexMap's
  deprecation guidance. Pre-launch breaking change in the public return
  type; acceptable per the pre-launch-breaking-change policy.
- **Item 20 — `Response::with_stdin_fragment(impl Into<String>)`.**
  Chainable alternative to `success_with_stdin(_, Vec<String>)`. Existing
  constructor kept for back-compat.

Also:

- **`SecretShowResponse::value` comment** documents the deliberate absence
  of `#[serde(default)]` (Azure always includes the `value` key; omission
  should error, not silently become `None`). `kid` comment documents
  that `#[serde(default)]` IS load-bearing for non-cert secrets.

Gates: fmt ✅ clippy ✅ test ✅ (435 → 442, +7) deny ✅ audit ✅.

Deferred post-v0.3.0 (per audit triage):
- gcp cert-bound comment hygiene (audit-trail only).
- azure tenant/subscription factory validation (low value — `az`
  accepts both GUIDs and domain names for `--tenant`).
- `azure_vault_url` dead-code removal (kept for future Level-3 probes).
- `deny.toml` AGPL exception-tightening (supply-chain future work).

Audit reports are in kb/wiki (non-tracked): three agent ranked-matrix
outputs + a consolidated triage. Release gate is now pending re-verify
smoke only.

Signed-off-by: Mandeep Patel <mandeep@techalchemist.io>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Signed-off-by: TechAlchemistX <mandeep@techalchemist.io>
@TechAlchemistX TechAlchemistX merged commit cfc8fe0 into main Apr 19, 2026
7 checks passed
@TechAlchemistX TechAlchemistX deleted the chore/v0.3-closing-audit branch April 19, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant