Skip to content

spec(012): the smoke harness reads the key per transport from a named key file (A-66) - #393

Merged
bartekus merged 1 commit into
mainfrom
spec/012-typesafe-key
Oct 29, 2026
Merged

bartekus merged 1 commit into
mainfrom
spec/012-typesafe-key

Conversation

@bartekus

Copy link
Copy Markdown
Contributor

Spec 012: amend 3.2 so the stage 2 smoke harness reads the key for the selected transport from a key file the owner names, and can use TYPESAFE_API_KEY for the direct transport. Records the owner's request as A-66. Status and implementation are unchanged.

Why

  • The owner asked that the Jev smoke also use TYPESAFE_API_KEY, in addition to AI_GATEWAY_API_KEY (A-66).
  • AI_GATEWAY_API_KEY is the Gateway credential; TYPESAFE_API_KEY belongs to TypeSafe's own API, which is 3.2's direct transport (POST <base>/v1/systemone, with a version pin). The adapter already implements direct; only the harness is fixed to the Gateway.
  • R-27's key file (/Users/bart/.config/statecrafting/infra/vercel/.env) no longer exists on the owner's machine, so the harness takes --key-file instead of a fixed path, and still never reads the key from the environment.

What changes

  • specs/012-jev-integration/spec.md: 3.2's key paragraph (--key-file, the variable per transport, --transport with gateway as default, direct with a version pin and only under spec 022 3.7 stage 2's owner authorization); an implementation record note.
  • docs/decisions/00-founding-decisions.md: A-66.
  • .statecraft/derived/: refreshed for the spec edit.

This authorizes no live call on direct. The harness change follows in impl(012).

… key file (A-66)

Amends 3.2: the stage 2 smoke harness takes --key-file and --transport, reading AI_GATEWAY_API_KEY for the Gateway transports and TYPESAFE_API_KEY for direct. R-27s fixed key file no longer exists. Authorizes no direct live call.
@github-actions

Copy link
Copy Markdown

AI review (no-findings)

Reviewing the two changed files: docs/decisions/00-founding-decisions.md (adds A-66) and specs/012-jev-integration/spec.md (amends 3.2 per A-66).

Decision record (A-66): The decision is internally consistent. It records an owner request, states what is amended (spec 012 3.2), and explicitly limits scope ("authorizes no direct live call: spec 022 3.7 stage 2 still needs the owner's authorization, inside R-29's testing cap"). The cited amendment reason (R-27's file no longer exists) is plausible. The date (2026-10-29) is consistent with the surrounding entries.

Spec 012 body amendment (3.2): The revised text:

  • Removes the hardcoded absolute path (/Users/bart/.config/statecrafting/infra/vercel/.env) which was a machine-specific artifact in spec text, replacing it with a --key-file parameter -- an improvement.
  • Preserves all key-handling security properties: "never from the environment", never logged, never in binding identity, never in exchange record, key file outside version control.
  • The phrase "never from the environment" disambiguates AI_GATEWAY_API_KEY / TYPESAFE_API_KEY as key names within the file, not env var fallbacks. This is consistent with A-66's wording.
  • Properly gates direct transport on spec 022 3.7 stage 2 owner authorization, consistent with A-66's explicit limitation.

Rationale block: The new rationale paragraph accurately summarizes the amendment, marks implementation as pending in examples/smoke.rs, and notes no stage 2 or 3 result changes. This is consistent with spec-first development (spec changes precede code).

Cross-reference consistency: A-66 ↔ spec 3.2 ↔ new rationale block are mutually consistent. The amendment annotation (amended 2026-10-29, A-66) in the spec body correctly cites the decision.

No concrete defects found.

{"head": "287b338a43ac347f4fa7c501796c4ab6eee5c0b9", "verdict": "no-findings", "findings": []}

Subject: bfe423c...287b338, diff digest 8c4cff0f89e0c1177439a85a842290658fe0f15b9d3216cb615ef23c8b9d9991, 1 call(s). An AI comment is not an approval.

@bartekus
bartekus added this pull request to the merge queue Oct 29, 2026
Merged via the queue into main with commit 99c7b8c Oct 29, 2026
30 checks passed
@bartekus
bartekus deleted the spec/012-typesafe-key branch October 29, 2026 23:53
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