refactor(layout): role contracts move to roles/ - root is bootstrap-only
Owner direction: the repository root holds first-class, bootstrap-required configuration only. conductor-policy.json is a ROLE contract (the conductor's authority), one of scores of future role contracts (agent-policy, coder-policy, ...) - such files get a dedicated home. - roles/conductor-policy.json (git mv) - conductor-apply.sh + test-conductor.sh read the new path - CONDUCTOR.md records the roles/ convention Closes UX follow-up from owner layout review; no issue (convention change).
This commit is contained in:
@@ -40,8 +40,9 @@ check() {
|
||||
git clone -q . "$SANDBOX/repo"
|
||||
# The clone carries committed state only - give the target its policy and
|
||||
# commit it so the tree starts clean (untracked policy would fail target_clean).
|
||||
cp conductor-policy.json "$SANDBOX/repo/conductor-policy.json"
|
||||
git -C "$SANDBOX/repo" add conductor-policy.json
|
||||
mkdir -p "$SANDBOX/repo/roles"
|
||||
cp roles/conductor-policy.json "$SANDBOX/repo/roles/conductor-policy.json"
|
||||
git -C "$SANDBOX/repo" add roles/conductor-policy.json
|
||||
git -C "$SANDBOX/repo" -c user.name=suite -c user.email=suite@local commit -q -m policy
|
||||
mkdir -p "$SANDBOX/data/workspaces" "$SANDBOX/data/runs"
|
||||
git clone -q "$SANDBOX/repo" "$SANDBOX/data/workspaces/stack-repo"
|
||||
@@ -66,8 +67,8 @@ target_clean() { [ -z "$(git -C "$TARGET" status --porcelain)" ]; }
|
||||
set_policy() { # enabled suites (commits: the target tree must stay clean)
|
||||
local suites="[\"$2\"]"
|
||||
printf '{"policyVersion":1,"autoApply":{"enabled":%s,"allowedPaths":["scripts/**","docs/**","README.md"],"suites":%s}}' "$1" "$suites" \
|
||||
> "$TARGET/conductor-policy.json"
|
||||
git -C "$TARGET" add conductor-policy.json
|
||||
> "$TARGET/roles/conductor-policy.json"
|
||||
git -C "$TARGET" add roles/conductor-policy.json
|
||||
git -C "$TARGET" -c user.name=suite -c user.email=suite@local commit -q -m "policy update"
|
||||
}
|
||||
set_policy true "test-config"
|
||||
@@ -131,9 +132,9 @@ ws_reset
|
||||
|
||||
# T8/T9: missing run + invalid policy
|
||||
check_rc "missing run exits 4" 4 scripts/conductor-apply.sh r-missing
|
||||
printf '{"policyVersion":9}' > "$TARGET/conductor-policy.json"
|
||||
printf '{"policyVersion":9}' > "$TARGET/roles/conductor-policy.json"
|
||||
check_rc "invalid policy exits 2" 2 scripts/conductor-apply.sh "$RUN_OK"
|
||||
git -C "$TARGET" checkout -q -- conductor-policy.json
|
||||
git -C "$TARGET" checkout -q -- roles/conductor-policy.json
|
||||
|
||||
echo
|
||||
echo "selftest: $PASS passed, $FAIL failed"
|
||||
|
||||
Reference in New Issue
Block a user