Skip to content

fix(spec): correct agent env-var drift to match shipped P-011 behavior#88

Merged
remyluslosius merged 1 commit into
mainfrom
fix/agent-spec-env-var-drift
Jun 15, 2026
Merged

fix(spec): correct agent env-var drift to match shipped P-011 behavior#88
remyluslosius merged 1 commit into
mainfrom
fix/agent-spec-env-var-drift

Conversation

@remyluslosius

Copy link
Copy Markdown
Contributor

Why

The agent specs still described the original L-014b opt-in mechanism (KENSA_USE_AGENT=1, default direct-SSH). But P-011 (Q1.c, ratified 2026-05-12) flipped agent-mode to the default and replaced the flag with the opt-out KENSA_NO_AGENT=1. The code, tests, and CHANGELOG shipped that change; the two agent specs (and CLAUDE.md, fixed separately) didn't follow.

This is spec/code drift the strict-coverage gate can't catch — it maps tests to ACs by annotation id, not by checking spec prose against the code. So the specs were quietly wrong while CI stayed green.

Changes

agent-cli-env-var (0.1.0 → 0.2.0 — the semantics actually flipped):

  • context / objective / scope / C-04 / C-06 / AC-04 now describe agent-mode as the default with KENSA_NO_AGENT=1 as the opt-out.
  • C-04 inverts the gating to os.Getenv("KENSA_NO_AGENT") != "1".
  • C-06's announce string matches the shipped agent mode (default; unset with KENSA_NO_AGENT=1) ....
  • AC-04 dropped TestRunRemediate_KensaUseAgent_Detection (that test was removed when the flag flipped — it no longer exists) and now points at the real gating site in cmd/kensa/main.go and the announce-line assertion in TestOpenAgent_AnnounceLine.
  • A historical note records the L-014b → P-011 reversal (the two remaining KENSA_USE_AGENT mentions are that history, same as the CHANGELOG Breaking-changes entry).

agent-handler-port-filepermissions (reference correction, no contract change, version unchanged):

  • KENSA_USE_AGENT → the agent-mode-default phrasing in objective + scope.
  • cmd/kensa/remediate.gocmd/kensa/main.go (remediate.go doesn't exist; the gating lives in main.go).

Safety

Spec-only, prose-level: no AC ids renamed, no test annotations touched, so the coverage mapping is unaffected. specter 119/119; both specs PASS at Tier 2 (7/7 and 9/9). No code change.

🤖 Generated with Claude Code

The agent specs still described the original L-014b opt-in mechanism
(KENSA_USE_AGENT=1, default direct-SSH), but P-011 (Q1.c ratified
2026-05-12) flipped agent-mode to the default and replaced the flag with
the opt-out KENSA_NO_AGENT=1. The code and tests shipped that change; the
specs and CLAUDE.md did not follow — spec/code drift the strict-coverage
gate can't catch (it maps tests to ACs by annotation id, not by checking
prose against code).

agent-cli-env-var (0.1.0 -> 0.2.0, the semantics flipped):
- context/objective/scope/C-04/C-06/AC-04 now describe agent-mode as the
  default with KENSA_NO_AGENT=1 as the opt-out; C-04 inverts the gating
  to `os.Getenv("KENSA_NO_AGENT") != "1"`; C-06's announce string matches
  the shipped `agent mode (default; unset with KENSA_NO_AGENT=1) ...`.
- AC-04 dropped its reference to TestRunRemediate_KensaUseAgent_Detection
  (removed when the flag flipped) and now points at the real gating site
  in cmd/kensa/main.go and the announce-line assertion in
  TestOpenAgent_AnnounceLine.
- A historical note records the L-014b -> P-011 sense reversal (the two
  remaining KENSA_USE_AGENT mentions are that history, like the CHANGELOG
  Breaking-changes entry).

agent-handler-port-filepermissions (reference correction, no contract
change, version unchanged):
- KENSA_USE_AGENT -> the agent-mode-default phrasing in objective + scope.
- cmd/kensa/remediate.go -> cmd/kensa/main.go (remediate.go does not
  exist; the gating lives in main.go).

Spec-only, prose-level: no AC ids renamed, no test annotations touched,
so coverage mapping is unaffected. specter 119/119; both specs PASS at
T2 (7/7 and 9/9). No code change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@remyluslosius remyluslosius merged commit b5c6a48 into main Jun 15, 2026
14 checks passed
@remyluslosius remyluslosius deleted the fix/agent-spec-env-var-drift branch June 15, 2026 10:10
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