Skip to content
Merged
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
8 changes: 5 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -480,9 +480,11 @@ gates a merge**, and no seat has to clear one.
A Claude Code cloud session (`CLAUDE_CODE_REMOTE=true`) holds one seat only: a **Builder in its own
session, on `MEFORORG/MessageFoundry` alone**. **Never attach a second repository**: a session with
several repositories loads hooks from none of them. Its `.git/mefor-coord` belongs to its own clone
and reaches no other session, so `seat.ps1 -Declare`, `mail.ps1`, `alloc.ps1` and `claim.ps1`
refuse there, and the declare rule above does not apply. A brief that needs an ADR number is not a
cloud brief. Cite the brief's item in the commit body, not the subject: the commit-msg claim gate
and reaches no other session. So the scripts that write state for other sessions to read refuse
there, at least `seat.ps1 -Declare`, `mail.ps1`, `alloc.ps1`, `claim.ps1`, `handoff.ps1`,
`lane.ps1` and `owner_log.py`, and the declare rule above does not apply. A clone-local lock or
cache is still written. `tests/test_coord_cloud_refusal.py` holds the census of which is which. A
brief that needs an ADR number is not a cloud brief. Cite the brief's item in the commit body, not the subject: the commit-msg claim gate
refuses a code commit whose subject cites a ledger number nobody claimed, and no claim can be taken
there. Commit under the allowlisted git identity the cloud environment sets, or `cla` blocks the PR.

Expand Down
15 changes: 13 additions & 2 deletions scripts/coord/handoff.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
nobody looks. The app's suggested remedy, `<worktree>\.git\mefor-coord\...`, cannot work: a
worktree's `.git` is a file. So a session drafts the document inside its own worktree, where the
edit tools work, and this script copies it into the shared directory. Exit 0 is written, 1 is a
refusal that names its reason, and 2 is a failure while writing.
refusal that names its reason, 2 is a failure while writing, and 3 is the refusal in a Claude
Code cloud session.

.EXAMPLE
pwsh -NoProfile -File scripts\coord\handoff.ps1 -Report
Expand All @@ -65,7 +66,8 @@ param(
# Move ONE entry to _retired-<date>/. Refuses on any hold unless -Force.
# -Retire, -Write and -From are NOT Mandatory, ON PURPOSE: a partial call binds the Retire or
# Write set without them (-Force alone, for one), and a Mandatory prompt there hangs a caller with
# stdin open (tests/_no_prompt.py, vault BACKLOG #3627). The refusal is right after this param block.
# stdin open (tests/_no_prompt.py, vault BACKLOG #3627). The partial-call refusal follows this
# param block, after the cloud refusal.
[Parameter(ParameterSetName = 'Retire')][string]$Retire,
[Parameter(ParameterSetName = 'Retire')][switch]$Force,

Expand All @@ -84,6 +86,15 @@ param(

$ErrorActionPreference = 'Stop'

# A CLAUDE CODE CLOUD SESSION REACHES NO OTHER SESSION THROUGH THIS SCRIPT: its --git-common-dir is
# the VM's own clone, so a write would "succeed" where nobody reads. CLAUDE.md section 5, "A cloud
# session is a Builder in its own session"; tests/test_coord_cloud_refusal.py holds the copies equal.
# Refused even with -CoordDir, as mail.ps1 refuses with -MailRoot. Exit 3 sits outside the 0/1/2 above.
if ($env:CLAUDE_CODE_REMOTE -eq 'true') {
[Console]::Error.WriteLine('handoff.ps1: refused in a Claude Code cloud session (CLAUDE_CODE_REMOTE=true). This VM''s .git/mefor-coord reaches no other session, so nothing was read or recorded.')
exit 3
}

# A partial -Retire or -Write call: refuse by name, before anything is read or written. See $Retire.
$missing = switch ($PSCmdlet.ParameterSetName) {
'Retire' { if (-not $Retire) { '-Retire <name>' } }
Expand Down
11 changes: 10 additions & 1 deletion scripts/coord/lane.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
param(
# NEITHER IS Mandatory, ON PURPOSE: a bare call, or one giving a single number, binds this default
# set without both, and a Mandatory prompt there hangs a caller with stdin open
# (tests/_no_prompt.py, vault BACKLOG #3627). The refusal is right after this param block.
# (tests/_no_prompt.py, vault BACKLOG #3627). The refusal follows this param block, after the
# cloud refusal.
[Parameter(ParameterSetName = 'State')][ValidateRange(0, 99)][int]$Free,
[Parameter(ParameterSetName = 'State')][ValidateRange(0, 99)][int]$InFlight,
[Parameter(ParameterSetName = 'State')][string]$Note = '',
Expand All @@ -35,6 +36,14 @@ param(
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'

# A CLAUDE CODE CLOUD SESSION REACHES NO OTHER SESSION THROUGH THIS SCRIPT: its --git-common-dir is
# the VM's own clone, so a write would "succeed" where nobody reads. CLAUDE.md section 5, "A cloud
# session is a Builder in its own session"; tests/test_coord_cloud_refusal.py holds the copies equal.
if ($env:CLAUDE_CODE_REMOTE -eq 'true') {
[Console]::Error.WriteLine('lane.ps1: refused in a Claude Code cloud session (CLAUDE_CODE_REMOTE=true). This VM''s .git/mefor-coord reaches no other session, so nothing was read or recorded.')
exit 3
}

# A level needs both numbers: refuse by name, before anything is read or written. See $Free. Bound,
# not truthy, because 0 is a real answer for either.
if ($PSCmdlet.ParameterSetName -eq 'State' -and
Expand Down
11 changes: 11 additions & 0 deletions scripts/coord/owner_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,17 @@ def main() -> int:
st = sub.add_parser("status", help="every item and its legs")
st.set_defaults(func=cmd_status)
a = p.parse_args()
# A CLAUDE CODE CLOUD SESSION REACHES NO OTHER SESSION THROUGH THIS SCRIPT: its --git-common-dir
# is the VM's own clone, so a write would "succeed" where nobody reads. CLAUDE.md section 5, "A
# cloud session is a Builder in its own session"; tests/test_coord_cloud_refusal.py holds the
# copies equal. Refused even with MEFOR_OWNER_LOG set, as mail.ps1 refuses with -MailRoot.
# Case-folded because the PowerShell copies compare with -eq, which ignores case.
if os.environ.get("CLAUDE_CODE_REMOTE", "").lower() == "true":
sys.stderr.write(
"owner_log.py: refused in a Claude Code cloud session (CLAUDE_CODE_REMOTE=true). This"
" VM's .git/mefor-coord reaches no other session, so nothing was read or recorded.\n"
)
return 3
result: int = a.func(a)
return result

Expand Down
9 changes: 9 additions & 0 deletions scripts/coord/tombstone-retired-backlog-allocator.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ param(

$ErrorActionPreference = "Stop"

# A CLAUDE CODE CLOUD SESSION REACHES NO OTHER SESSION THROUGH THIS SCRIPT: its --git-common-dir is
# the VM's own clone, so a write would "succeed" where nobody reads. CLAUDE.md section 5, "A cloud
# session is a Builder in its own session"; tests/test_coord_cloud_refusal.py holds the copies equal.
# Refused even with -GitCommonDir, as mail.ps1 refuses with -MailRoot.
if ($env:CLAUDE_CODE_REMOTE -eq 'true') {
[Console]::Error.WriteLine('tombstone-retired-backlog-allocator.ps1: refused in a Claude Code cloud session (CLAUDE_CODE_REMOTE=true). This VM''s .git/mefor-coord reaches no other session, so nothing was read or recorded.')
exit 3
}

# Far above any real ledger number, and a round one so it reads as deliberate. The vault ledger was
# under #1900 when this was written; it would take a thousand years at the current rate to reach this.
$TombstoneNumber = 1000000
Expand Down
11 changes: 11 additions & 0 deletions scripts/worktree/hygiene-report.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,17 @@ param(
)

$ErrorActionPreference = 'Stop'

# A CLAUDE CODE CLOUD SESSION REACHES NO OTHER SESSION THROUGH THIS SCRIPT: its --git-common-dir is
# the VM's own clone, so a write would "succeed" where nobody reads. CLAUDE.md section 5, "A cloud
# session is a Builder in its own session"; tests/test_coord_cloud_refusal.py holds the copies equal.
# Refused even with -OutDir, as mail.ps1 refuses with -MailRoot: the report describes this VM's
# worktrees, which no session outside it can act on.
if ($env:CLAUDE_CODE_REMOTE -eq 'true') {
[Console]::Error.WriteLine('hygiene-report.ps1: refused in a Claude Code cloud session (CLAUDE_CODE_REMOTE=true). This VM''s .git/mefor-coord reaches no other session, so nothing was read or recorded.')
exit 3
}

# A non-zero git or gh exit is DATA here (a missing remote, a failed fetch), never a throw.
$PSNativeCommandUseErrorActionPreference = $false
# A scheduled task has nobody to answer a credential prompt, in a terminal or in Git Credential
Expand Down
Loading
Loading