Skip to content
Draft
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
3 changes: 3 additions & 0 deletions pmoves/docs/AGENTS/AGNOTE4482PHI.t1.md
Original file line number Diff line number Diff line change
Expand Up @@ -3333,3 +3333,6 @@ VILLAGE RULE: delivery delegated to a delivery-agent body; control and memory ar
- `2026-10-08T17:11:06Z` RELEASE `B850-CLAUDE (Knuckles)` branch: `feat/b850-memory-travels` · scope: Landed in PR #3313 (merge 23b3aada4). - Memory and bus reachability: the roster normalizer P6 rewrites the docker-only NATS host to loopback for host-run MCP servers; the launcher checks for brv; cipher checkpoints are stamped with harness and model. - Fleet cipher 401 stays documented, not fixed: each node's cipher authenticates against its own token store. The stopgap (minting a token on Z890) is still pending with the operator.
- `2026-10-08T17:11:14Z` RELEASE `B850-CLAUDE (Knuckles)` branch: `feat/claude-family-identity-bindings` · scope: Landed in PR #3313 (merge 23b3aada4). - Aggregate identity resolver: an identity binds on any node, and the register name off home is <BASE> (<node>). - The claim-collision owner key is now (identity, node). Per the operator decision of 2026-10-08, identities with no home are also split per node, and the model is never part of the key. - Corpus control: 0 of 792 owner reads changed for homed identities; 47 changed for identities with no home. - One lane correctly reopens: row 2026-07-28T16:30:00Z CLAIM CRUSH-GLM52 (SPARK) feat/cipher-agent-scope. A bare CRUSH RELEASE on Knuckles about PR #2288 had closed it, and that branch has no PR. Its owner, crush on spark, should finish it or release it by name.
- `2026-10-08T17:11:15Z` CLAIM `B850-CLAUDE (Knuckles)` branch: `docs/agint-passport-design` · **TTL 72h (expires `2026-10-11T17:11:15Z`)** · scope: AGInT PASSPORT DESIGN (operator go 2026-10-08, after #3313 merged). DESIGN DOC ONLY, no code; security review comes before any implementation. Deliverable: plans/AGINT_PASSPORT_DESIGN_2026-10-08.md, a living, token-backed agent card per identity and a CHIT bundle per identity, covering: - the identity umbrella (voice, theme, avatar, glyph, signature card, ACK; aliases map back to it); - a per-identity Ed25519 key via pmoves-keygen and keygen_cards.py, with domain-separated signing on the tally-signer-ed25519 pattern; - travels as a signed, hash-chained log anchored to cgp.v2 merkle roots, mirrored to Neo4j once the :Agent key conflict is settled; - MEASURED node verification at launch: a fingerprint probe compared with node_evidence in the vocabulary, with a match / new-node / could-not-measure verdict; - model provenance verified at launch against the model registry and provider verifier; the model is attributed but never part of the key; - forks and lineage; - call-me info and fleet visibility over NATS; - token registration for all AGInTZ: soulbound standing credit from kept commitments, minting rules, the backing-mix decision, and no governance votes; - cipher signed-request auth. Reviewers invited: Z890-CLAUDE (glances), spark-claude (Laya, second-node cross-check), the A0 corpus owner (jev); chit-compliance-reviewer and code-review for security.
- `2026-10-10T00:57:22Z` CLAIM `Z890-CLAUDE` branch: `fix/env-local-key-windows-fchmod` · **TTL 48h (expires `2026-10-12T00:57:22Z`)** · scope: WINDOWS PARITY for operator-run env-local road (env_local_key.py): os.fchmod/os.fchown are POSIX-only, so make env-local-set crashed AttributeError on Z890 (Windows Git Bash) after cipher-mint-token had already consumed its piped bearer, orphaning one z890-claude token row. Fix e939a15a4 + a pytest that strips fchmod/fchown so Linux CI covers the Windows path. Origin: per-agent cipher token bind for Z890-CLAUDE (CIPHER_TOKEN_Z890_CLAUDE minted + bound 2026-10-09). Recon filed, not yet scoped as lanes: preflight stops at first failing gate with no next-step helper (topology-chit-gate: archon missing pmoves_api net, botz-gateway loopback NATS_URL); claude-pmoves is not a PMOVES-registry/ACP harness entry (claude_z890 declares no surface). Those get their own branches.
- `2026-10-10T01:11:26Z` NOTE `Z890-CLAUDE` branch: `fix/env-local-key-windows-fchmod` · scope: REVIEW of draft PR 3317 (AGInT passport design), COMMENTED, ACK::z890-claude::passport-design-REVIEW-2026-10-09. Five observations from the Windows-native, multi-boot node: (1) section 3c probe fields are Linux-only, so on Z890 under Git Bash all strong fields are unreadable and the verdict is always 3 (Windows equivalents readable without elevation: board, GPU PNP ids, MachineGuid); (2) multi-boot makes machine-id and tailnet id per-slot, leaving k=3 of 5 with no margin; (3) the 0600 custody line has no Windows meaning, and PR 3328 is the live example; (4) node-hosts-broker conflated with identity-publishes-nothing; (5) call-me info should name rooms: z890-infra.room.fabric already binds agent z890-claude with voice and ops-chat. CORRECTION to this session's earlier framing: Z890-Claude is not uncallable and does not need a new headless service. It has a P7 room (stage rehearsal, publishes empty by registry design per ROOM_MANIFEST_CONTRACT); lane 3 is the rehearsal to live transition via the CHIT activation checklist, coordinated with B850 mention-routing lane, not a parallel path.
- `2026-10-10T11:11:24Z` CLAIM `Z890-CLAUDE` branch: `feat/cipher-agentid-from-token` · **TTL 48h (expires `2026-10-12T11:11:24Z`)** · scope: Pmoves-cipher (fork, base PMOVES.AI-Edition-Hardened): when a request carries a bound per-agent token, agentId becomes optional and defaults to the token agent; a supplied mismatching agentId still answers 403, and bootstrap/unbound tokens still require it. One concern: MCP tool schemas (required list), MCP call handler, REST memory routes, plus unit tests in test/unit/pmoves. NOT in this lane: card_id column/migration, reconcile tool, launcher prose removal (separate PRs). Operator go 2026-10-10. Avoids Pmoves-cipher auth.ts profile-header work already in flight.
17 changes: 13 additions & 4 deletions pmoves/tools/env_local_key.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ def _backup(path: Path, data: bytes) -> Path:
except FileExistsError:
continue
try:
os.fchmod(fd, 0o600)
_fchmod(fd, 0o600)
with os.fdopen(fd, "wb") as fh:
fh.write(data)
fh.flush()
Expand Down Expand Up @@ -231,14 +231,23 @@ def _warn_lost_owner(owner: tuple[int, int]) -> None:
file=sys.stderr)


def _fchmod(fd: int, mode: int) -> None:
"""os.fchmod where it exists. Windows has no os.fchmod (AttributeError, not
OSError, so the callers' `except OSError` never caught it) and no POSIX mode
bits to tighten; the mode passed to os.open/mkstemp is all it honours."""
fchmod = getattr(os, "fchmod", None)
if fchmod is not None:
fchmod(fd, mode)


def _atomic_write(path: Path, data: bytes, mode: int,
owner: tuple[int, int] | None) -> None:
# `<name>.tmp-*` so the leftover of a crash still matches the `.env.*`
# ignore rule (a leading-dot prefix made it `..env.local.tmp-*`).
fd, tmp = tempfile.mkstemp(prefix=f"{path.name}.tmp-", dir=str(path.parent))
try:
os.fchmod(fd, mode)
if owner is not None:
_fchmod(fd, mode)
if owner is not None and hasattr(os, "fchown"): # POSIX only
try:
os.fchown(fd, *owner)
except PermissionError:
Expand Down Expand Up @@ -269,7 +278,7 @@ def __init__(self, path: Path):
raise Refused(f"audit log not writable ({exc.__class__.__name__}); "
"nothing changed") from exc
try: # re-tighten a pre-existing looser file
os.fchmod(self.fd, 0o600)
_fchmod(self.fd, 0o600)
except OSError:
pass

Expand Down
71 changes: 71 additions & 0 deletions pmoves/tools/tests/test_env_local_key_windows.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# pmoves/tools/tests/test_env_local_key_windows.py
"""env_local_key must work where ``os.fchmod`` / ``os.fchown`` do not exist.

Windows Python has neither. The original call sites sat behind ``except OSError``,
but a missing function raises ``AttributeError``, so ``make env-local-set`` died on
Windows after ``cipher-mint-token`` had already consumed its piped bearer. These
tests strip both functions so Linux CI exercises the Windows path.
"""
import io
import os
import stat

import pytest

from pmoves.tools import env_local_key as elk

SECRET = "cipher_0123456789abcdef0123456789abcdef"


def _run(env_file, audit, *argv, value=None):
stdin = io.StringIO(value if value is not None else "")
return elk.main(
["--file", str(env_file), "--audit-log", str(audit), *argv], stdin=stdin
)


@pytest.fixture
def windows_like(monkeypatch):
"""Remove the POSIX-only calls exactly as a Windows interpreter lacks them."""
monkeypatch.delattr(os, "fchmod", raising=False)
monkeypatch.delattr(os, "fchown", raising=False)
assert not hasattr(os, "fchmod") and not hasattr(os, "fchown")


def test_set_new_file_without_fchmod_fchown(tmp_path, windows_like):
env, audit = tmp_path / ".env.local", tmp_path / "audit.jsonl"
assert _run(env, audit, "set", "CIPHER_TOKEN_Z890_CLAUDE", value=SECRET + "\n") == 0
assert f"CIPHER_TOKEN_Z890_CLAUDE={SECRET}" in env.read_text()


def test_set_existing_file_takes_the_owner_branch(tmp_path, windows_like):
# An existing file makes _commit pass an owner tuple to _atomic_write, which is
# the path that reached os.fchown.
env, audit = tmp_path / ".env.local", tmp_path / "audit.jsonl"
env.write_text("KEEP=1\n")
assert _run(env, audit, "set", "NEW_KEY", value="v\n") == 0
text = env.read_text()
assert "KEEP=1" in text and "NEW_KEY=v" in text


def test_unset_and_has_without_fchmod_fchown(tmp_path, windows_like):
env, audit = tmp_path / ".env.local", tmp_path / "audit.jsonl"
env.write_text("A=1\nB=2\n")
assert _run(env, audit, "unset", "A") == 0
assert "A=1" not in env.read_text() and "B=2" in env.read_text()
assert _run(env, audit, "has", "B") == 0


def test_audit_log_never_carries_the_value(tmp_path, windows_like):
env, audit = tmp_path / ".env.local", tmp_path / "audit.jsonl"
assert _run(env, audit, "set", "CIPHER_TOKEN_Z890_CLAUDE", value=SECRET + "\n") == 0
assert SECRET not in audit.read_text()


@pytest.mark.skipif(not hasattr(os, "fchmod"), reason="POSIX mode bits only")
def test_posix_preserves_the_existing_mode(tmp_path):
env, audit = tmp_path / ".env.local", tmp_path / "audit.jsonl"
env.write_text("A=1\n")
env.chmod(0o644)
assert _run(env, audit, "set", "NEW_KEY", value="v\n") == 0
assert stat.S_IMODE(env.stat().st_mode) == 0o644
Loading