Repository navigation
feat(lab-mode): per-repo config toggle — harness.config.json labMode replaces the host-wide flag file - #435
Merged
Merged
Conversation
…replaces the host-wide flag file
Move the lab-mode on/off switch from an ambient host flag file to a per-repo
config key. New `labMode: {enabled, target}` in lib/config.ts (default
{enabled:false, target:"full"}) — UNSET = OFF, so a repo that never opts in
pays zero per-turn inject.
- resolution: the repo's harness.config.json, and nothing else. The host scope
(~/.sidecar/lab-mode) is retired — one ambient file turning EVERY unrelated
repo's turns into delegation directives is exactly what this removes. One repo
can no longer enable another; --global/--host is refused.
- pre-config flag files (.harness/lab-mode · fable-mode · host twins) are never
consulted: `status` reports them as IGNORED, `on`/`off` clear them (repo ones
deleted, host ones renamed *.retired so the user's own file is kept).
- on/off write-back preserves sibling keys (lockdown-add precedent), writes via
tmp+rename, and REFUSES to overwrite a malformed config (no settings loss).
`off` keeps the target so a later bare `on` can restore it.
- this repo commits labMode {enabled:true, target:"full"} so its current
behavior carries over with no gap; every other repo opts in on its own.
Hook wiring (hooks.json · setup.ts · pi/sidecar.ts) and the directive text are
unchanged — both agent surfaces keep calling `sidecar lab-mode inject`, and the
inject budget is untouched.
Design delegated to lab full (fable + sol) and reconciled: {enabled,target}
schema from sol (matches memGuard/annotationGuard; off keeps target) over
fable's single-string; no init.ts scaffolding per fable (other toggles omit
defaults too); host flag renamed rather than deleted per sol. Both models
recommended honoring legacy repo flags for one release — dropped on the user's
rule that an unset key is false, full stop.
dancinlife
added a commit
that referenced
this pull request
Jul 26, 2026
…l|full (no {enabled,target} pair) (#436)
Collapse the config key to a single value: the backend name IS the on-switch, so
`{enabled:false, target:"sol"}`-style zombie states become unrepresentable. This
carries the old flag-file property ("one value per scope, contradiction
impossible") into the config, and reads the same as the CLI verb you type.
- lib/config.ts: labMode: "off" | "fable" | "sol" | "full", DEFAULTS "off".
- unset stays OFF, and now anything UNRECOGNIZED is OFF too — a typo ("fabel")
can neither silently enable nor pass as a deliberate off; `status` prints
`← unrecognized, treated as OFF` so the mistake is visible.
- write-back simplifies to raw.labMode = <string> (sibling keys preserved,
tmp+rename, malformed config still refused).
- `off` no longer remembers the last target — inherent to one value, and bare
`on` = full is unchanged, so there is no practical regression.
No compat branch for the object form shipped in #435: it existed only in this
repo's own config, normalized to "full" in this same commit.
Hook wiring and the directive text are untouched; inject budget unchanged.
Co-authored-by: dancinlife <mk55911@proton.me>
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.
Move the lab-mode on/off switch from an ambient host flag file to a per-repo
config key. New
labMode: {enabled, target}in lib/config.ts (default{enabled:false, target:"full"}) — UNSET = OFF, so a repo that never opts in
pays zero per-turn inject.
(~/.sidecar/lab-mode) is retired — one ambient file turning EVERY unrelated
repo's turns into delegation directives is exactly what this removes. One repo
can no longer enable another; --global/--host is refused.
consulted:
statusreports them as IGNORED,on/offclear them (repo onesdeleted, host ones renamed *.retired so the user's own file is kept).
tmp+rename, and REFUSES to overwrite a malformed config (no settings loss).
offkeeps the target so a later bareoncan restore it.behavior carries over with no gap; every other repo opts in on its own.
Hook wiring (hooks.json · setup.ts · pi/sidecar.ts) and the directive text are
unchanged — both agent surfaces keep calling
sidecar lab-mode inject, and theinject budget is untouched.
Design delegated to lab full (fable + sol) and reconciled: {enabled,target}
schema from sol (matches memGuard/annotationGuard; off keeps target) over
fable's single-string; no init.ts scaffolding per fable (other toggles omit
defaults too); host flag renamed rather than deleted per sol. Both models
recommended honoring legacy repo flags for one release — dropped on the user's
rule that an unset key is false, full stop.