Skip to content

Consume persisted governance intent in governance status - #104

Open
mochan-tk wants to merge 2 commits into
mainfrom
mochan-tk-task-101-supervisor
Open

Consume persisted governance intent in governance status#104
mochan-tk wants to merge 2 commits into
mainfrom
mochan-tk-task-101-supervisor

Conversation

@mochan-tk

Copy link
Copy Markdown
Owner

Closes #101

Plan: #101 (comment)

Summary

governance-status.sh now sources solo/team intent from the persisted
repository Actions variable SCAFFOLD_GOVERNANCE_PROFILE by default (GET
repos/{owner}/{repo}/actions/variables/SCAFFOLD_GOVERNANCE_PROFILE),
accepting only the exact value solo or team. Explicit --profile solo|team remains a one-shot override that short-circuits the persisted
lookup entirely (the endpoint is never read when an override is given).
A valid persisted value flows through the same BASE/TEAM derivation and
emit call as an equivalent explicit profile, so behavior is identical
regardless of source. Fixture tests were committed first and proven
expected-red before the implementation commit.

Evidence

Criterion Evidence (command / link) Result
Fixed fixtures committed first, expected-red before implementation Tests-only commit 7b54028 stashed against pre-#101 governance-status.sh: bash .github/scripts/tests/run-tests.sh governance-status → 132/138 passing, 6 new persisted-intent cases failed (red), reproduced locally and recorded in the implementation-release comment pass
GET for the variable when --profile omitted; exact solo/team only governance-status.sh lines 79-87; unit tests "persisted solo intent…", "persisted team intent…" pass
Valid persisted value → ACTIVE, same controls/order/exit as explicit run -R o/r with mk_govvar solo/team vs --profile solo/team; bash .github/scripts/tests/run-tests.sh governance-status → 138/138 pass
Missing/disabled/failed/malformed/empty/whitespace/case/other → UNKNOWN, exit 3 Unit tests: missing variable, 6-value invalid loop ('', ' solo', 'solo ', 'Solo', 'TEAM', 'nonsense'), missing value field, non-JSON payload, simulated actions/variables API failure — all rc=3, governance.profile UNKNOWN pass
Explicit --profile takes precedence, never reads the endpoint, preserves #92 Unit test "explicit --profile overrides persisted intent" (scoped GH_CALLS diff proves no call to the variables endpoint); full --profile test matrix (solo/team/checks/usage errors) unchanged and passing pass
GET-only; fails on any mutating call bash .github/scripts/tests/run-tests.sh governance-status → "sensor performed GET-only gh calls", "every gh invocation is a plain gh api read", "shim wall refuses mutating invocations" all pass pass
Existing aggregation/bypass/source-binding/Actions/CODEOWNERS/merge-queue/UNKNOWN precedence/Bash 3.2/output order unchanged outside profile-source selection Full pre-existing 132-case suite unchanged and passing; live explicit --profile solo probe against mochan-tk/agentic-dev-kit-for-copilot pass
PR stays within ~400 changed lines across the two owned paths git diff --numstat origin/main...HEAD -- .github/scripts/governance-status.sh .github/scripts/tests/test-governance-status.sh → 107 pass
gh auth status Logged in, GH_TOKEN active pass
bash .github/scripts/tests/run-tests.sh governance-status 138 case(s), 0 failed pass
Live explicit probe (--profile solo) rc=0, governance.profile\tACTIVE\tsolo pass
Live persisted probe (no --profile) rc=3, governance.profile\tUNKNOWN\tno profile declared; pass --profile solo|team (this repository has not opted into SCAFFOLD_GOVERNANCE_PROFILE, so UNKNOWN/exit 3 is the correct, non-guessed result) pass
bash .github/scripts/tests/run-tests.sh (full wall) 23 guard test file(s) passed pass
git ls-files -z ".github/*.sh" | xargs -0 shellcheck -S style clean, no output pass
check-action-pins.sh All action references are SHA-pinned pass
check-workflow-permissions.sh 16 job(s) checked, OK pass
check-escalation-wording.sh OK, 20 surfaces scanned pass
check-template-sync.sh OK, issue forms and body templates in sync pass
check-md-links.sh OK, 44 references resolve pass
check-changelog-refs.sh OK, 47 references within #200 pass
check-connectors.sh OK, 2 connector definitions conform pass
check-copilot-surface.sh OK, skills/agents/prompts/instructions validated pass

Deviations

None. Implementation matches the plan of record exactly: only the two
owned files were touched, --profile remains a one-shot override with no
persisted read, and every other sensor behavior (aggregation, bypass
qualification, source binding, exit precedence, Bash 3.2 compatibility,
line-oriented output) is unchanged.

Follow-ups

None.

Checklist

  • Plan was posted as a Task-issue comment before implementation and is
    linked above.
  • Diff stays inside the issue's File ownership paths (single-writer
    rule, or a declared agreements wording rider).
  • Every command in the issue's Verification section was run; output captured above.
  • No test, lint rule, or CI check was deleted, skipped, or weakened.
  • Record-before-report comment posted on the Task issue. (Per the
    worker protocol — session-orchestration skill — a worker never posts
    the ritual/outcome comments on the Task issue; the supervisor
    independently verifies this PR and posts the outcome comment.)
  • All persistent artifacts in this PR are English-only.

mochan-tk and others added 2 commits August 17, 2026 15:42
Add gh-fixture-driven cases to test-governance-status.sh covering
persisted solo/team intent, absence, invalid values (empty, leading and
trailing whitespace, case variants, arbitrary value), a malformed
(missing-field and non-JSON) response, an Actions-disabled/unauthorized
read failure, and explicit --profile override precedence over a
persisted value. These 6 new cases fail against the current sensor,
which does not yet read SCAFFOLD_GOVERNANCE_PROFILE (expected red,
verified locally before this commit).

Refs #101

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
governance-status.sh now sources solo/team intent from the persisted
repository Actions variable SCAFFOLD_GOVERNANCE_PROFILE
(repos/{owner}/{repo}/actions/variables/SCAFFOLD_GOVERNANCE_PROFILE)
when --profile is omitted, accepting only the exact value solo or team
(never trimmed, never case-folded). A missing variable, an
Actions-disabled target, an API/authorization failure, a malformed
response, an empty value, a whitespace or case variant, or any other
value all leave the profile unresolved, which the existing
governance.profile UNKNOWN / exit-3 path already reports. Explicit
--profile solo|team remains a one-shot override: it is checked before
the persisted lookup and short-circuits it, so the endpoint is never
read when an override is given and nothing is ever persisted. A valid
persisted value flows through the same BASE/TEAM derivation and emit
call as the equivalent explicit profile, so required controls,
source-binding requirements, output order, and exit behavior are
identical regardless of source.

Closes #101

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

Consume persisted governance intent in governance status

1 participant