Skip to content

feat: who decides: escalation policy, question class and context gate (#78) - #93

Merged
lx-0 merged 11 commits into
mainfrom
feat/78-who-decides
Nov 15, 2026
Merged

lx-0 merged 11 commits into
mainfrom
feat/78-who-decides

Conversation

@lx-0

@lx-0 lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member

What changes

A coordinator now decides what no plan line and no standing entry reserves, and records it in DECISIONS.md. A person gets a question only for an item of a closed list, and every question names where it comes from and what it is for.

  1. escalate: in PREFERENCES.md (hooks/lib/git-ctx.sh, YT_PREF_ESCALATE): a comma separated subset of violation, deviation, irreversible, secret, spend, default all five. An invalid item warns and reads as all five (like merge_by: a typo never takes a class away from the person). reserved (a plan line that says verdict, approval or sign-off, or a standing entry) always holds.
  2. Question class (bin/ytstack-questions): new files carry class: escalation|info and because:. new --decides <who> needs --because <item> and refuses an item that is not on the project's list (exit 64, with "decide it yourself and record it in DECISIONS.md"). new --info <who> asks for a fact and decides nothing. check validates class and because.
  3. Context gate: new writes Source: and Purpose: lines under ## Context; ask refuses a question while either has no value (a <placeholder> is none).
  4. coordinate Step 8: the default above, "a plan line reserves only with verdict, approval or sign-off", --because/--info, and the reason in the AskUserQuestion re-ground. The preamble prints ESCALATE and the class of each waiting question. Line 6 of the operating checklist (injected after every compaction) carries the rule.

Callers updated: ytstack-upkeep --question writes its report as class: info with Source and Purpose; reassess-roadmap gates, lesson and review-lessons proposals write --because reserved. init-project template and README carry the key; this repo's PREFERENCES.md sets the full list.

Decisions

  • Old question files without class/because stay valid and read as escalation; check validates an item against all six, not against today's project list. ask requires Source/Purpose also for old files (that is the point of the gate).
  • decides: keeps its name for both classes: under info it is the person asked for the fact.
  • escalate: can only narrow the five; more goes into a plan line or a standing entry.
  • DECISIONS entry: "2026-11-15: A coordinator decides what nobody reserved; a person gets only a closed list of escalations, and a question names its source and purpose (issue coordinate: who decides is undefined, non-critical questions keep reaching the human #78)". Skill versions: coordinate 0.7.0, reassess-roadmap 0.3.2, review-lessons 0.1.2, lesson 0.2.1, init-project 0.2.3.

Verification (on the merged head 52db7bb)

  • bash tests/run-all.sh: ALL SUITES PASSED (35 suites; ytstack-questions 102, git-ctx 177, skill-preambles 737, ytstack-upkeep 159, 0 failed)
  • bash tests/run-all.sh --linux from a git archive export: ALL SUITES PASSED
  • python3 bin/ytstack-check: OK (10 warnings, all pre-existing recommended-section warnings plus none from this change)
  • bin/ytstack-spec lint: 0 failures, 0 warnings; bin/ytstack-spec drift: no area to look at
  • bin/ytstack-questions check on this repo's own Q001 (written before this change): questions ok: 1 file(s)

Codex review is at its usage limit; an independent review runs separately.

Closes #78

🤖 Generated with Claude Code

lx-0 and others added 6 commits November 15, 2026 19:44
)

yt_prefs reads escalate: as a comma separated subset of violation,
deviation, irreversible, secret, spend (default all five) into
YT_PREF_ESCALATE. An invalid item warns and reads as all five, so a
typo never takes a class away from the person.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ytstack-questions new --decides needs --because <item> (escalate list or
reserved) and writes class: escalation; --info <who> writes class: info.
ask refuses a question whose Context has no Source: or Purpose: line.
check validates class and because; files without them stay valid and
read as escalation. ytstack-upkeep writes its report as class info.
The format and the Who decides list live in docs/ux/coordinator-format.md,
with line 6 of the operating checklist.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
#78)

coordinate Step 8: what the plan or a standing entry does not reserve,
the coordinator decides and records in DECISIONS.md; a plan line reserves
only with verdict, approval or sign-off. The preamble prints ESCALATE and
the class of each waiting question. reassess-roadmap, lesson and
review-lessons write their questions as reserved with Source and Purpose;
init-project and README carry the new key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The area lists hooks/lib/git-ctx.sh for the vendor resolution; the new
escalate preference does not touch it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T19:25:12.028734Z 52db7bb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 52db7bb991

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread bin/ytstack-questions
# the project's list of today.
cls=$(fm "$f" class); why=$(fm "$f" because)
case "$cls" in
''|info) ;;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reject escalation reasons on info questions

When a user manually edits or creates an info question with because: deviation (or any other valid escalation reason), check reports the file as valid because this branch imposes no constraint on why, and the later allow-list check accepts the reason. This contradicts the new format, where info decides nothing and must use because: none, and lets contradictory metadata reach the coordinator as info (deviation); require because to be unset/none for this class.

Useful? React with 👍 / 👎.

lx-0 and others added 5 commits November 15, 2026 20:51
…g purpose (#78)

Review of PR #93: the case reset Source too, so it passed without the
section guard. Mutation check: removing 'on &&' in context_names now fails it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The coordinate injection is close to its 9500 cap and the checklist is
never cut.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Both sides kept: main's DECISIONS entries first, one CHANGELOG
[Unreleased], coordinate 0.7.1 (above 0.6.3 and 0.7.0).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@lx-0
lx-0 merged commit ed0dc9a into main Nov 15, 2026
4 checks passed
@lx-0
lx-0 deleted the feat/78-who-decides branch November 15, 2026 22:51
lx-0 added a commit that referenced this pull request Nov 15, 2026
Kept both sides: the operating checklist has #93's line 6 and this
branch's lines as 7 and 8; DECISIONS with main's entries first; spec
lines combined. coordinate 0.7.2 and finish-lane 0.7.1, a patch above
both sides.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lx-0 added a commit that referenced this pull request Nov 15, 2026
…ields before them

With #93's checklist line a coordinate session near the cap lost its
standing list to the pointer line while the directive's tail stayed.
The order is now: ..., closing line, using-ytstack body (with a pointer
to the file), standing pointer last, as #74 decided. The Next action is
still never cut.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
lx-0 added a commit that referenced this pull request Nov 15, 2026
…, no PR closes, rotation (#82, #83) (#94)

* feat: parked lane status; the open-PR cap counts PRs ready for review (#83)

ytstack-frontier set <lane> --status parked holds a lane whose pull
request waits open, for a cap or a person; upkeep lists it as held and
ytstack-status counts it in review. The open-prs gate of
ytstack-finish-lane counts open pull requests that are not drafts and
fails when more than 100 are open.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat: hooks read a stale checkout from origin and keep a coordinator on its path (#82, #83)

#82: on the default branch behind origin/<default> (local refs, no
fetch) SessionStart and Stop read the pointer and Next action from
origin's STATE.md and say how far behind the checkout is
(yt_behind_origin). The Stop task reminder is said once per session and
pointer, never in a coordinate session, and a pointer older than
YT_POINTER_STALE_DAYS (3) days is STATE lint W10 instead. The Next
action is no longer cut for the 10,000-char cap: the using-ytstack body
yields last, with a pointer to its file. A manual handoff older than the
automatic one is listed as older.

#83, coordinate mode only, hints never denies: pre-tool-use-agent (now
also on Bash) on an Agent dispatch without isolation, on gh pr merge
and on gh pr close; pre-compact counts compactions beside the marker,
SessionStart says "Compaction N of this coordinator: ... rotate now",
Stop repeats it once per compaction from the second; post-tool-use-bash
notes ytstack:lesson when gh run list --branch <default> shows a
failed run.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* feat: coordinate and finish-lane never close a lane PR; every round runs ytstack-frontier check (#83)

coordinate 0.7.0 and finish-lane 0.6.0: a hard-gate sentence against
closing, reopening to retrigger or deleting the branch of a lane's pull
request (a cap waits as parked, a check reruns with gh run rerun); the
cap counts pull requests ready for review. coordinate Step 5 starts
every round of the loop with ytstack-frontier check and acts on each
stale: line (exit 2) before any new dispatch; Step 12 names the
compaction line. The operating checklist gets the loop check and the
merge/close rule; coordinator-format documents parked and the new hooks.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: spec, DECISIONS and CHANGELOG for the coordinator path (#82, #83)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: host-adapters names the Bash matcher and the uncovered hints; dependencies verified (#82, #83)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: YT_BIN line yields when the using-ytstack body was cut (#82)

The body cut stops at a line end and can leave room; the YT_BIN line
still does not take it, as issue #85 decided for the Next action.
Found by the Linux run (shorter temp paths).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: read origin's STATE.md only when strictly behind and unedited; skip user scope (PR #94 review)

yt_behind_origin now needs a .ytstack inside the checkout whose STATE.md
origin has (user scope and an untracked STATE.md stay out entirely), and
hands out origin's copy only when HEAD is an ancestor of origin/<default>,
origin changed STATE.md since the merge base and the working tree's copy
is HEAD's. Diverged or edited with an origin change: SessionStart reads
the local file and says "N ahead, M behind", no --ff-only. Stop prunes
old session dirs that only hold stop-said when it makes a new one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: coordinate hints read commands, not text; red main per workflow and repo; compactions counted anywhere (PR #94 review)

pre-tool-use-agent finds gh pr merge/close per line and segment, after
assignments, if/then, wrappers, env, xargs and gh -R/--repo, and ignores
quoted text and comments. post-tool-use-bash counts only the newest run
of each workflow and only origin's repository under --repo/-R.
pre-compact counts a coordinator's compaction before the .ytstack exit.
The status test keeps an in-review row beside the parked one.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: the open-PR cap limits opening, never a merge (PR #94 review)

With closing a lane PR forbidden, an open-prs gate on merge deadlocks.
gates and merge drop --max-open; open-pr --max-open opens a draft at the
cap (drafts do not count) and says so. coordinate dispatches no new
implement lane at the cap; a parked PR leaves the count with
gh pr ready --undo and comes back with gh pr ready. The two new checklist
lines are shorter.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: spec, DECISIONS and CHANGELOG for the PR #94 review fixes

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: dependencies area verified against the lib change (PR #94 review)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs: dependencies area verified after the merge (only lib additions, no gstack)

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix: standing lines stay the last block cut; the using-ytstack tail yields before them

With #93's checklist line a coordinate session near the cap lost its
standing list to the pointer line while the directive's tail stayed.
The order is now: ..., closing line, using-ytstack body (with a pointer
to the file), standing pointer last, as #74 decided. The Next action is
still never cut.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
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.

coordinate: who decides is undefined, non-critical questions keep reaching the human

1 participant