Skip to content

feat: coordinate mode: standing instructions and enforced operating path (#72-#76) - #87

Merged
lx-0 merged 26 commits into
mainfrom
feat/72-73-standing
Nov 15, 2026
Merged

lx-0 merged 26 commits into
mainfrom
feat/72-73-standing

Conversation

@lx-0

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

Copy link
Copy Markdown
Member

What changed

#72: standing instructions are recorded under load

  1. Detection hook hooks/standing-prompt (UserPromptSubmit, second entry): in a coordinate session it counts every human prompt and flags one that reads like a standing instruction (English and German word list: always, never, from now on, until, while, prioritise, don't touch, remember; immer, nie, ab jetzt, bis, waehrend, priorisiere, fass ... nicht an, denk dran). A flagged prompt gets one line of context: record it with ytstack-standing add before the next dispatch. Files and grep only, fail open.
  2. Stop check: hooks/stop blocks once (decision: block, stop_hook_active respected) when flagged prompts have no entry since: an entry counts when its name time is in or after the minute of the first flagged prompt, in the working tree or added on any ref (local branches, the remote-tracking branch a pushed standing PR left). Local git only, no network. The same prompts never block twice.
  3. bin/ytstack-standing add|end|list: add writes the entry in its own worktree outside the checkout on standing/<YYYYMMDD>, validates it with ytstack-check --standing, commits, pushes and opens one PR per UTC day (through ytstack-pr-watch create when pr_watch=on and the session has an id, else gh pr create), or reports the open one as updated. --here (and user scope always) writes in place. Exit 3 when the commit stands but push or PR failed.
  4. Preamble visibility: the coordinate preamble prints ytstack-standing list, whose first line is the newest entry's age and the human prompts this session sent since.
  5. Memory vs. standing: coordinate Step 9 uses ytstack-standing add and says agent-private memory is no substitute; Step 3 acts on ended entries, conditions and failed checks.

#73: temporary and conditional entries

  • Optional keys until (ISO UTC, after given), until-condition (a sentence), until-check (a command, exit 0 = ended). list and the readers show active entries only; list adds sections for ended entries, conditions to check now and failed checks.
  • Ending = a new entry of kind: end that supersedes the old one (ytstack-standing end <entry> --reason ...), append-only.
  • ytstack-check --standing validates the new keys.

#74: standing entries reach every context

  • hooks/session-start injects the active entries for the session's role (coordinator with the marker, else lane), also after a compaction; files only, a passed until applied, at most six lines, shed for the cap after Next action, factory tools, the minimal-code line and the closing line (three lines, then a pointer).
  • The coordinate preamble lists the readable entries, superseded and ended ones skipped; yt_standing (finish-lane, signal-intake) skips expired and kind: end entries too.
  • Optional check: key: a command whose failure is shown in the preamble as a compliance warning.
  • ytstack-brief render has a "Standing instructions" section with the entries for lanes (review: reviewers) or no role.
  • Scope vocabulary for the role filter in docs/ux/coordinator-format.md, "Scope and roles"; a scope naming no role is for everyone.

#76 (and part of #75): the operating path in coordinate mode

Design decisions

  • Coordinate mode = a session marker the coordinate preamble writes under ${XDG_STATE_HOME:-~/.local/state}/ytstack/sessions/<session id>/coordinate (yt_session_home), not yt_state_base: CLAUDE_PLUGIN_DATA reaches hooks only, never the Bash tool. LANES.md was rejected as the signal: it exists for every session of a project that ever coordinated.
  • Claude Code only for the hooks: Codex registers no ytstack UserPromptSubmit/Agent hook, a Kimi shell has no session id. Documented in host-adapters and coordinator-format.
  • until-check may stand alone (the command is the condition). until-check and check run only in ytstack-standing list (coordinate preamble), bash -c in the toplevel, stdin closed, 5 s each (YTSTACK_STANDING_TIMEOUT), at most 10 per call; never in a hook. A change under standing/ already goes to a person.
  • Ending is a kind: end entry, not an edit.
  • The PreToolUse hook warns, it does not deny: a lookup agent needs no brief.
  • Escalation N = 3 sessions in a row.
  • Pfadfinder fix: a Next action shorter than the omission note is no longer replaced by the (longer) note when the injection is near the cap.
  • Three DECISIONS entries (2026-11-15): coordinate-mode marker; until keys and where commands run; the operating path and escalation.

Review fixes (independent review and Codex)

  • Commands only from merged entries (high): check/until-check run only for a working-tree entry identical to the default branch's. Pending entries are read only from local standing/* branches and their upstreams, shown, never run; a remote-only branch is not read. DECISIONS entry "A standing entry's command runs only when the entry is merged ...".
  • Pending entries reach the SessionStart injection and the lane briefs (yt_standing_lines), marked, with the role filter.
  • A new day's branch starts from the newest pending standing branch, so end/--supersedes of an entry waiting in an earlier day's PR validates; an earlier day's unpushed branch is pushed first.
  • Lint streak counts a session once when the lint was there at any of its stops (a session that starts with a status question now counts).
  • Classifier matches instruction phrases, not single words, and skips a prompt that is one question; all reported false positives are negative fixtures.
  • Lookup agent types (Explore, Plan, search agents) without a brief are neither warned nor counted as dispatches.
  • Timeouts kill the command's process group; the 10-command limit is named per entry; --until/--supersedes/--slug/--base reject newlines.
  • pre-tool-use-agent falls back to python3 without jq.
  • Later Codex rounds: pending entries reach SessionStart before the checkout has standing/; the lint counter is keyed by the repo key in the marker (user scope) and counts overlapping sessions once each; briefs carry each entry's whole text, list a pending entry's whole text; add finds a master default branch without origin/HEAD; a repository with commits but no known default branch runs no command; skill-preambles defines eq.
  • coordinate and resume-session find the automatic handoff the PreCompact hook wrote under CLAUDE_PLUGIN_DATA (yt_latest_handoff).
  • Near the injection cap the standing list shrinks to three before the Next action is cut, and an omitted Next action gets back the room later shedding frees.

Verification (real output)

  • python3 bin/ytstack-check: OK (with 9 warning[s]) (the 9 pre-existing Process Flow / MUST warnings).
  • bash tests/run-all.sh (macOS bash 3.2, after the review fixes): ALL SUITES PASSED, 34 suites; new or extended: ytstack-standing 91 passed, hooks-standing 58 passed, hooks-coordinate 42 passed, hooks-readonly 88 passed, hooks-json 86 passed, git-ctx 162 passed, ytstack-check 82 passed, ytstack-brief 214 passed, skill-preambles 676 passed.
  • bash tests/run-all.sh --linux (Docker, bash 5.3.9, from a git archive export of 62e5d3f): ALL SUITES PASSED, 34 suites. The first Linux run caught a test that assumed the default branch main; fixed in its own commit.
  • The reviewer's repros: remote.sh leaves no PWNED file, classify.sh flags none of its prompts, cap.sh keeps the Next action.
  • ytstack-standing add was tested against a local bare remote behind an insteadOf GitHub URL with a stubbed gh, including the real ytstack-pr-watch create path; no standing PR was opened on this repository.

Not covered: a live Claude Code session (whether task notifications reach UserPromptSubmit is unverified; the LANES check then sees dispatches only). #76.3 and #76.5 and #75 gaps 2 and 3 are another agent's PR.

Closes #72
Closes #73
Closes #74
Closes #76
Part of #75

🤖 Generated with Claude Code

lx-0 and others added 10 commits November 15, 2026 14:39
…check key (#73, #74)

yt_standing skips entries whose until passed and entries of kind end;
yt_standing_fields and yt_standing_lines expose every key and filter by
role; yt_session_home is the per-session state both hooks and the Bash
tool find. ytstack-check --standing validates until, until-condition,
until-check, check and kind.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)

add writes one entry in its own worktree on standing/<YYYYMMDD>, commits,
pushes and opens or updates one pull request per UTC day (ytstack-pr-watch
create with the PR watch on); --here and user scope write in place. end
closes an entry with a kind-end entry. list prints active, pending, ended,
to-check and failed-check entries and the prompts since the newest one;
until-check and check run only here, bounded by a timeout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nce when unrecorded (#72)

Active only with the coordinate session marker. The prompt hook counts
human prompts and flags ones that read like standing instructions; the
Stop hook blocks once when flagged prompts got no entry in the working
tree or on any local ref since.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
)

session-start injects the active entries for the session's role
(coordinator with the marker, else lane), files only, cut last for the
cap; ytstack-brief render adds the entries for lanes or reviewers.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ists them (#72, #73, #74)

The preamble writes the coordinate session marker and prints
ytstack-standing list; Step 9 uses ytstack-standing add and says agent
memory is no substitute; Step 3 acts on ended entries, conditions and
failed checks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ns (#72, #73, #74)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…art and printed by the preamble (#76)

The checklist lives once in docs/ux/coordinator-format.md between
markers; session-start injects it in a coordinate session in place of the
minimal-code line, the coordinate preamble prints it. The cap sheds the
closing line and then the standing list before it; a Next action shorter
than the omission note is kept.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…md and a lagging STATE pointer (#76, part of #75)

hooks/pre-tool-use-agent (PreToolUse on Agent, Task, SendMessage) adds a
warning when the prompt has no rendered-brief line and logs dispatches.
The Stop hook warns once per session when LANES.md lags the dispatches
and reports or the STATE pointer is behind, and blocks once when the
same lint came in three sessions in a row.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

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

Copy link
Copy Markdown
Codex Review Summary: ❌ Failed

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

Review Status Commit Review trigger
📝 Code Review ❌ Failed 2026-11-15T16:03:23.382050Z
We couldn’t complete this review. Comment @codex review to try again.
1234c16 Manual request
ℹ️ 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: 8551ba18cb

ℹ️ 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-standing Resolved
Comment thread bin/ytstack-brief Resolved
Comment thread hooks/pre-tool-use-agent Resolved
Comment thread bin/ytstack-standing Resolved
lx-0 and others added 6 commits November 15, 2026 15:44
…from local branches (PR #87 review 1-3, 6, 8-10)

list ran check/until-check of entries on any origin/standing/* branch:
code execution for anyone who can push a branch. Commands now run only
for a working-tree entry identical to the default branch's; pending
entries come from local standing/* branches and their upstreams only,
are shown and never run. Pending entries reach yt_standing_lines (the
injection and the briefs). A new day's branch starts from the newest
pending one so end/--supersedes see it; an earlier unpushed day branch
is pushed first. Timeouts kill the process group, the 10-command limit
is named, --until/--supersedes/--slug/--base take one line.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…okups are no dispatches (PR #87 review 4, 5, 7)

The streak counts a session once when the lint was there at any stop,
also after a first stop before the first dispatch. The prompt classifier
matches instruction phrases instead of single words and skips a prompt
that is only a question. Agent calls of lookup types without a brief are
neither warned nor counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…action

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k wrote

The preambles looked under yt_state_base, which in the Bash tool is not
CLAUDE_PLUGIN_DATA; yt_latest_handoff searches every base a hook uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… review)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ng on PR #87)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lx-0

lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: d79c5a102d

ℹ️ 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 hooks/session-start Resolved
Comment thread hooks/stop Resolved
lx-0 and others added 2 commits November 15, 2026 16:02
… streak keyed by the marker's repo key (Codex findings on PR #87)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t, latest handoff lookup

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lx-0

lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: f95562f4e8

ℹ️ 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-standing Resolved
Comment thread tests/skill-preambles.test.sh Resolved
lx-0 and others added 2 commits November 15, 2026 16:22
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ter default branch (Codex findings on PR #87)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lx-0

lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@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: f56421fa69

ℹ️ 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-standing Resolved
Comment thread hooks/session-start Resolved
Comment thread hooks/stop Resolved
lx-0 and others added 2 commits November 15, 2026 16:41
…, overlapping sessions counted once (Codex findings on PR #87)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… sessions

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lx-0 and others added 2 commits November 15, 2026 16:48
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…le again (#73 examples)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lx-0

lx-0 commented Nov 15, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

lx-0 and others added 2 commits November 15, 2026 19:01
# Conflicts:
#	.ytstack/DECISIONS.md
#	.ytstack/spec/artifacts.md
#	.ytstack/spec/checks-and-evals.md
#	.ytstack/spec/dependencies.md
#	.ytstack/spec/hooks-and-state.md
#	.ytstack/spec/skills.md
#	CHANGELOG.md
#	hooks/lib/git-ctx.sh
#	hooks/stop
#	skills/coordinate/SKILL.md
…or gstack change in the lib)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@lx-0
lx-0 merged commit f6158b1 into main Nov 15, 2026
4 checks passed
@lx-0
lx-0 deleted the feat/72-73-standing branch November 15, 2026 18:13
lx-0 added a commit that referenced this pull request Nov 15, 2026
Resolves DECISIONS and spec/skills.md against #87: the #91 entry follows
main's entries; coordinate moves to 0.6.3 since #87 took 0.6.2; the
hooks-and-state decision line is folded to stay under 200 lines.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lx-0 added a commit that referenced this pull request Nov 15, 2026
Conflicts resolved keeping both sides: DECISIONS with main's entries first
and this branch's six after; one [Unreleased] in CHANGELOG; the spec area
files carry both sides' text (bin/ytstack-brief: #87's standing section and
this branch's plan-first, report shape and check). code-review and
spawn-milestone-team were bumped on both sides and go to 0.5.2. The brief
tests now pin the "# Brief: <ref> (<project>)" marker as the first line of
the plan-first and granularity-slice briefs too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
lx-0 added a commit that referenced this pull request Nov 16, 2026
* chore: move the gstack-derived skills' upstream baseline to v1.99.5.0

bin/ytstack-gstack-diff --stat reported office-hours, plan-ceo-review,
retro and ship behind v1.99.5.0. The upstream change only renames
/autoplan to /plan-eng-review in next-step recommendations and examples.
ytstack has no autoplan and already names ytstack:plan-eng-review, so
no method change is folded in; the baseline moves for all six skills
(plan-eng-review and document-release had no upstream change) and each
skill's metadata.version gets a patch bump.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: release 0.12.0

Manifests (Claude Code, marketplace, Codex, Kimi), README badge and
status, QUICKSTART upgrade line from 0.11.x, CHANGELOG section 0.12.0
with a summary line and compare link. Covers PRs #77, #87-#94 (issues
#70, #72-#76, #78, #81-#86, #91).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: spec areas: skills verified at the gstack v1.99.5.0 baseline; host-adapters verified at the 0.12.0 manifests

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: STATE and ROADMAP for 0.12.0: what shipped outside milestones, next action, open issues

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* chore: KNOWLEDGE: eval record for release 0.12.0 (13 cases, all 1.00, $6.37)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment