fix(spec): correct agent env-var drift to match shipped P-011 behavior#88
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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-outKENSA_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):KENSA_NO_AGENT=1as the opt-out.os.Getenv("KENSA_NO_AGENT") != "1".agent mode (default; unset with KENSA_NO_AGENT=1) ....TestRunRemediate_KensaUseAgent_Detection(that test was removed when the flag flipped — it no longer exists) and now points at the real gating site incmd/kensa/main.goand the announce-line assertion inTestOpenAgent_AnnounceLine.KENSA_USE_AGENTmentions 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.go→cmd/kensa/main.go(remediate.godoesn't exist; the gating lives inmain.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