diff --git a/core/skills/backlog/SKILL.md b/core/skills/backlog/SKILL.md index 2ad35c16..100fba5e 100644 --- a/core/skills/backlog/SKILL.md +++ b/core/skills/backlog/SKILL.md @@ -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 diff --git a/core/skills/work-issue/SKILL.md b/core/skills/work-issue/SKILL.md index 005823c0..307db299 100644 --- a/core/skills/work-issue/SKILL.md +++ b/core/skills/work-issue/SKILL.md @@ -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 `. 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), diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index e8756ab2..49620cba 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -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 diff --git a/docs/DELEGATION.md b/docs/DELEGATION.md index b5f6da56..0fa0adc9 100644 --- a/docs/DELEGATION.md +++ b/docs/DELEGATION.md @@ -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 ` +outside protected production checkouts and a self-contained brief: The first shell command enters that task tree; repeat `cd &&` at the start of every shell command, including reads and background launches. @@ -414,7 +414,7 @@ Model/effort: 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 ; 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: +Output: Shell commands: Keep cleanup/removal and commit operations separate and simple; do not hide commands in scripts to evade approval review. Verification: Integration executor: diff --git a/src/loopzero/sandbox.py b/src/loopzero/sandbox.py index 5edb2449..6f725e28 100644 --- a/src/loopzero/sandbox.py +++ b/src/loopzero/sandbox.py @@ -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() diff --git a/tests/test_sandbox.py b/tests/test_sandbox.py index ecff7435..674e4d8a 100644 --- a/tests/test_sandbox.py +++ b/tests/test_sandbox.py @@ -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={'*': ('.',)}) @@ -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: