fix(cascade): validate operating_context as a path, not a filepath #313

Merged
coilysiren merged 1 commit from fix/operating-context-os-independent-clean into main 2026-08-20 05:55:53 +00:00
Owner

operating_context entries are logical owner/repository identifiers, but the cleanliness check ran filepath.Clean on them. That is OS-specific: on Windows it rewrites owner/repository to owner epository, so Clean(value) != value for every well-formed entry and LoadConfig rejects all of them.

That made agent-compose unusable on native Windows, a catch-22: compose requires operating_context, and the same binary refuses every value it can hold. Even foo/bar failed, and the backslash spelling is rejected on purpose, so no config could both validate and compose.

Change

  • path.Clean instead of filepath.Clean: forward-slash and OS-independent, which is what an owner/repository identifier wants.
  • strings.HasPrefix(value, "/") instead of filepath.IsAbs, which was the same OS-specific trap.
  • The split drops filepath.ToSlash, because the backslash rejection above it already guarantees forward slashes.

Behaviour on unix is unchanged: path.Clean and filepath.Clean agree there.

Verification on kai-tower-3026 (native Windows)

Against the shipped v2.32.0 and this build, on the same config:

$ agent-compose config validate probe.yaml          # v2.32.0
operating_context: repository "coilyco-flight-deck/agentic-os" must be a clean owner/repository path

$ ./acompose-fixed config validate probe.yaml       # this branch
exit=0

And a full compose run against an isolated HOME, which v2.32.0 cannot start at all:

cascade outputs=2 load-points=2 repository-plan=1 changed=5
skills  managed=336 load-points=2 verified=0 linked=336 removed=0 preserved=0
exit=0

go test ./... on Windows goes from 33 failures to 12, with 22 tests fixed and 0 newly broken across cascade, compose, converge, and nativelaunch. Most of those tests write operating_context into their fixture config and were failing at LoadConfig.

Two new tests pin the behaviour: forward-slash entries load, and the malformed spellings (backslash, absolute, unclean, trailing slash, wrong segment count, empty, duplicate) stay rejected.

Not in scope

The 12 remaining Windows failures are separate portability defects, all pre-existing on main: path separators baked into assertions, HOME vs USERPROFILE in TestResolveSkillLoadPointsDefaultsWireClaudeAndCodex, a stale palette snapshot, embedded-roster mismatches, and a skillmount verified/preserved split in TestConvergeComposesRosterIntoCascade. Worth their own issue.

Closes coilyco-flight-deck/infrastructure#887.

`operating_context` entries are logical `owner/repository` identifiers, but the cleanliness check ran `filepath.Clean` on them. That is OS-specific: on Windows it rewrites `owner/repository` to `owner epository`, so `Clean(value) != value` for every well-formed entry and `LoadConfig` rejects all of them. That made `agent-compose` unusable on native Windows, a catch-22: `compose` requires `operating_context`, and the same binary refuses every value it can hold. Even `foo/bar` failed, and the backslash spelling is rejected on purpose, so no config could both validate and compose. ## Change - `path.Clean` instead of `filepath.Clean`: forward-slash and OS-independent, which is what an owner/repository identifier wants. - `strings.HasPrefix(value, "/")` instead of `filepath.IsAbs`, which was the same OS-specific trap. - The split drops `filepath.ToSlash`, because the backslash rejection above it already guarantees forward slashes. Behaviour on unix is unchanged: `path.Clean` and `filepath.Clean` agree there. ## Verification on kai-tower-3026 (native Windows) Against the shipped v2.32.0 and this build, on the same config: ``` $ agent-compose config validate probe.yaml # v2.32.0 operating_context: repository "coilyco-flight-deck/agentic-os" must be a clean owner/repository path $ ./acompose-fixed config validate probe.yaml # this branch exit=0 ``` And a full `compose` run against an isolated `HOME`, which v2.32.0 cannot start at all: ``` cascade outputs=2 load-points=2 repository-plan=1 changed=5 skills managed=336 load-points=2 verified=0 linked=336 removed=0 preserved=0 exit=0 ``` `go test ./...` on Windows goes from 33 failures to 12, with **22 tests fixed and 0 newly broken** across `cascade`, `compose`, `converge`, and `nativelaunch`. Most of those tests write `operating_context` into their fixture config and were failing at `LoadConfig`. Two new tests pin the behaviour: forward-slash entries load, and the malformed spellings (backslash, absolute, unclean, trailing slash, wrong segment count, empty, duplicate) stay rejected. ## Not in scope The 12 remaining Windows failures are separate portability defects, all pre-existing on `main`: path separators baked into assertions, `HOME` vs `USERPROFILE` in `TestResolveSkillLoadPointsDefaultsWireClaudeAndCodex`, a stale palette snapshot, embedded-roster mismatches, and a `skillmount` verified/preserved split in `TestConvergeComposesRosterIntoCascade`. Worth their own issue. Closes coilyco-flight-deck/infrastructure#887.
fix(cascade): validate operating_context as a path, not a filepath
All checks were successful
ci / test (pull_request) Successful in 50s
17c56b4269
operating_context entries are logical owner/repository identifiers. The
cleanliness check ran filepath.Clean on them, which is OS-specific: on
Windows it rewrites "owner/repository" to `owner\repository`, so
Clean(value) != value for every well-formed entry and the loader rejects
all of them. The result was a catch-22 on native Windows, because compose
requires operating_context but the same binary refuses every value it can
hold. Even foo/bar failed, and the backslash spelling is rejected on
purpose, so no config could both validate and compose.

path.Clean is forward-slash and OS-independent, which is what an
owner/repository identifier wants. Absolute entries are now rejected by
their leading slash rather than by filepath.IsAbs, which was the same
OS-specific trap, and the split drops filepath.ToSlash because the
backslash rejection above it already guarantees forward slashes.

Two tests pin the behaviour: forward-slash entries load, and the
malformed spellings stay rejected. On Windows this turns 22 failing
tests green across cascade, compose, converge, and nativelaunch, and
`agent-compose compose` converges a real host config for the first time.

Closes coilyco-flight-deck/infrastructure#887.
coilysiren deleted branch fix/operating-context-os-independent-clean 2026-08-20 05:55:54 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
coilyco-flight-deck/agent-compose!313
No description provided.