Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions core/skills/backlog/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ description: Inspect live GitHub issues and PRs read-only for next work, backlog

Answer the requested live-state question from current GitHub and repository
evidence. Default to read-only: a pickup recommendation does not start work or
create a branch/worktree. Use REST `gh api --method GET`; confirm repository and
access. Inspect relevant issues, acceptance, comments, designs, linked PRs,
create a branch/worktree. Confirm the repository and access, then read GitHub
through REST. Inspect relevant issues, acceptance, comments, designs, linked PRs,
checks and threads, plus local branches/worktrees for collisions.

Separate observations from recommendations. If live access fails, label the
Expand Down
2 changes: 1 addition & 1 deletion core/skills/work-issue/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ a decision or requesting production-change approval, follow
Before continuing an existing branch or PR, follow
[inherited-work guidance](reference.md#inherited-work).

Retain an inherited task worktree or use `loopzero start` for a new delivery.
Retain an inherited task worktree or use `loopzero start <task-slug>`.
Record observable acceptance and the issue link. Deliver through
[implement](../implement/SKILL.md). Follow the linked safeguards for
[API shape changes](reference.md#api-shape-changes),
Expand Down
8 changes: 5 additions & 3 deletions docs/ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,9 +109,11 @@ loading the delivery [commands](../src/loopzero/cli.py), which implement the con
target branch and required CI. The receipt must record a clean passing run
at that head with the current commands and check settings digest. A settings
change or an older receipt without the digest requires a fresh check. The
digest covers execution and stage reuse settings, including the effective
allowlisted environment, without recording raw environment values. Waiters
check for policy changes on every poll.
digest covers execution and stage reuse settings without recording raw
environment values. It excludes only inherited `HEAVY_SLOT_GRANTED_CORES`
for local sandbox receipts. Explicit settings, delegated runner environments
and stage reuse keys still bind the grant. Waiters check for policy changes
on every poll.
Local readiness and hosted eligibility carry a review forward only across
a first-parent chain of verified merges from the configured PR base. They
reconstruct each merge in an isolated Git repository and compare its tree
Expand Down
6 changes: 3 additions & 3 deletions docs/DELEGATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -396,8 +396,8 @@ Formal delivery review is `loopzero review`.

## Briefs and ownership

Give each writing delegate its own `loopzero start` worktree outside any
protected production checkout and a self-contained brief:
Give each writing delegate a worktree from `loopzero start <task-slug>`
outside protected production checkouts and a self-contained brief:

The first shell command enters that task tree; repeat `cd <own-task-tree> &&`
at the start of every shell command, including reads and background launches.
Expand All @@ -414,7 +414,7 @@ Model/effort: <resolved from the task repository's models.toml>
Effort policy: Children inherit this policy; return to the parent before raising effort or launching a stronger model.
Launch policy: Children inherit this rule: never approval-required; use auto only for read-only children and say "read-only, do not edit" in the brief; a child that runs commands or edits inherits the parent's mode, because auto can stall on approval review. After launch, verify pendingRequestCount 0 and a completed tool call.
Waiting: One blocking wait: Codex exec/write_stdin yield >=30 s (>=120 s for builds, tests, CI, review, ready or merge); shell `until <done>; do sleep 30; done`. Claude: background notification or t3_background_wait. Read the completed result once; never use t3_thread_read/task_status for liveness. Every ended turn wakes the parent: end it only with a final result, a blocker or a question, never with a progress note while your own job runs.
Output: <Coordinator rollover caps. Use `gh api --jq` at source.>
Output: <Coordinator rollover caps. Select GitHub REST fields with `--jq`.>
Shell commands: Keep cleanup/removal and commit operations separate and simple; do not hide commands in scripts to evade approval review.
Verification: <focused owning tests and coverage; available proof methods and their task-scoped authorization within runtime permissions>
Integration executor: <named executor for returned heads and one owner of any readiness/merge waiter; parent retains acceptance responsibility>
Expand Down
3 changes: 3 additions & 0 deletions src/loopzero/sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,9 @@ def settings_fingerprint(config: Config, worktree: Path, *, base: str | None = N
settings = _execution_settings(config, base)
if config.check_runner and settings["runner_executable"] is None:
return None
if not config.check_runner and "HEAVY_SLOT_GRANTED_CORES" not in config.env:
# The inherited local worker limit is transient. Stage reuse still binds it.
settings["environment"].pop("HEAVY_SLOT_GRANTED_CORES", None)
payload = [settings, config.inputs]
return hashlib.sha256(json.dumps(payload, sort_keys=True).encode()).hexdigest()

Expand Down
11 changes: 10 additions & 1 deletion tests/test_sandbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -749,10 +749,13 @@ def cache(config, *, clean=False, verify_reuse=False):

@pytest.mark.parametrize('change', ['other', 'input', 'shared', 'command', 'network', 'environment', 'version',
'failed', 'boolean_exit_code', 'dirty_receipt', 'keyless',
'dirty_tree', 'legacy'])
'dirty_tree', 'legacy', 'grant'])
def test_declared_input_reuse(git_repo, bwrap_log, monkeypatch, fetched_base, change):
cfg = make_config(checks=('echo one', 'echo two'),
inputs={'echo one': ('*.md',), 'echo two': ('*.md',), '*': ('shared',)})
if change == 'grant':
cfg = replace(cfg, env_allowlist=(*cfg.env_allowlist, "HEAVY_SLOT_GRANTED_CORES"))
monkeypatch.setenv("HEAVY_SLOT_GRANTED_CORES", "2")
for inputs in ({}, {'*': ()}, {'*': ('uv.lock',)}):
assert sandbox._input_key(replace(cfg, inputs=inputs), git_repo, 'unlisted', fetched_base) is None
whole = replace(cfg, inputs={'*': ('.',)})
Expand All @@ -776,6 +779,12 @@ def test_declared_input_reuse(git_repo, bwrap_log, monkeypatch, fetched_base, ch
cfg = replace(cfg, network=True)
elif change == 'environment':
monkeypatch.setenv('LZ_KEEP', 'changed')
assert _current_check_report(git_repo, cfg, fetched_base) is None
elif change == 'grant':
monkeypatch.setenv("HEAVY_SLOT_GRANTED_CORES", "4")
assert _current_check_report(git_repo, cfg, fetched_base) is not None
monkeypatch.delenv("HEAVY_SLOT_GRANTED_CORES")
assert _current_check_report(git_repo, cfg, fetched_base) is not None
elif change == 'version':
monkeypatch.setattr(sandbox, '__version__', 'new')
else:
Expand Down
Loading