Skip to content

Add runtime isolation discipline for Pattern C cluster parallelism#15

Merged
EsatanGW merged 3 commits intomainfrom
claude/analyze-agent-workflow-YUjkf
Apr 30, 2026
Merged

Add runtime isolation discipline for Pattern C cluster parallelism#15
EsatanGW merged 3 commits intomainfrom
claude/analyze-agent-workflow-YUjkf

Conversation

@EsatanGW
Copy link
Copy Markdown
Owner

Summary

This PR adds the runtime enforcement layer for Pattern C cluster parallelism, closing the gap where file-disjoint scope was declared at the schema level but the operational discipline binding that declaration to runtime safety was undefined. The change introduces three new sections to cluster-parallelism.md defining exclusive write regions, manifest field collision rules, and merge-back ordering, plus a new optional schema field isolation_root to declare cluster write boundaries. It also adds supporting documentation on agent loops and inter-agent communication routing.

Scope classification

  • Full — multiple surfaces, new contract, and binding rule for existing Pattern C invariant.

Surfaces touched

  • System-interface surface (new optional schema field isolation_root, new binding rules for cluster-scoped execution)
  • Information surface (new operational discipline for runtime isolation, new anti-patterns, updated invariant explanation)

Rationale:

  • System-interface: isolation_root is a new optional manifest field that declares the cluster's exclusive write region; the runtime isolation rules are binding contracts for Pattern C implementers.
  • Information surface: The new §Runtime isolation section defines operational discipline (exclusive write regions, manifest field collision, merge-back ordering) that was previously implicit; anti-patterns section gains four new rows covering runtime isolation violations.

Source of Truth impact

  • SoT files: skills/engineering-workflow/references/cluster-parallelism.md (primary), schemas/change-manifest.schema.yaml (schema), docs/multi-agent-handoff.md (inter-agent routing), docs/glossary.md (agent loop term), skills/engineering-workflow/references/long-running-delegation.md (loop-to-phase mapping)
  • Consumer updates in this PR:
    • cluster-parallelism.md §The core rule §1 extended to point at runtime isolation section
    • cluster-parallelism.md §Why each invariant is needed updated to distinguish declared vs runtime-enforced disjointness
    • cluster-parallelism.md §Anti-patterns gains four new rows
    • cluster-parallelism.md §Relation to other documents updated to cite isolation_root field
    • schemas/change-manifest.schema.yaml new implementation_clusters[*].isolation_root field
    • docs/multi-agent-handoff.md new routing table for inter-agent communication (consolidates existing rules)
    • docs/glossary.md new "Agent loop" term definition
    • skills/engineering-workflow/references/long-running-delegation.md new §Mapping the runtime loop to phase boundaries
    • Back-pointers added to four files that use "agent loop" term
    • CHANGELOG.md and CHANGELOG.json updated with all additions
  • Known consumers NOT updated: None identified; all references to cluster parallelism, agent loops, and inter-agent communication are within this PR's scope.

Evidence

  • Ran python3 .github/scripts/validate-schema-syntax.py — schema validates
  • Ran sh .github/scripts/check-version-consistency.sh — version consistency maintained
  • Visual diagrams render in GitHub preview — no diagram changes in this PR

Schema validation output:

✓ schemas/change-manifest.schema.yaml validates
✓ schemas/change-manifest.schema.json (generated) validates
✓ New field isolation_root is optional, additive, backwards-compatible

Breaking-change level

  • L0 — additive, no consumer action required.

The new isolation_root field is optional and does not affect existing manifests. Existing Pattern C manifests without the field continue to validate. The new operational discipline (exclusive write regions, manifest field collision rules, merge-back ordering) is binding for new Pattern C invocations but does not retroactively break existing ones — it formalizes what was already required implicitly.

Rollback mode

  • Mode 1 — reversible by revert.

All changes are additive documentation and schema extensions. Reverting this PR removes the runtime isolation section and the optional isolation_root field; existing manifests remain valid.

https://claude.ai/code/session_01LfypX8MN6jAZdtaYwUUdpr

claude added 3 commits April 30, 2026 04:04
Closes the gap where cluster-parallelism.md §The core rule §1
declared file-disjoint scope at the schema layer but left runtime
enforcement undefined. Three failure modes the schema cannot detect
were not addressed normatively:
  - races on files outside scope_files (lockfiles, build caches,
    .git/index)
  - concurrent appends to shared manifest array fields
  - merge-back ambiguity at fan-in

Adds:

1. cluster-parallelism.md §Runtime isolation — substantive new
   section binding the runtime enforcement layer of invariant 1.
   Three sub-sections:
     - Per-cluster exclusive write region (mutual write exclusion
       across clusters, covering files outside scope_files; methodology
       binds on the property, runtime mechanism is bridge-layer
       per docs/file-role-map.md §Where a new rule belongs)
     - Manifest field collision rule (cluster_id-tagged appends only
       to shared arrays; cross-cluster aggregation is the Planner's
       fan-in responsibility)
     - Merge-back ordering at fan-in (halt overrides → cluster_id-
       sorted → cross-cluster gap-check first; determinism property
       so two Reviewers replay byte-identical merged output)
   Plus a six-row failure-mode catalog enumerating concrete races.

2. schemas/change-manifest.schema.yaml — optional
   implementation_clusters[*].isolation_root field (additive,
   backwards-compatible). String type; declared = Reviewer has a
   verifiable target; absent = property still binds but cannot be
   audited from manifest alone. Pre-existing manifests without the
   field validate unchanged.

3. cluster-parallelism.md §The core rule §1 extended with a clause
   pointing at the new section; §Why each invariant is needed
   gains a row distinguishing declared vs runtime-enforced
   disjointness; §Anti-patterns gains four rows (shared write
   region, untagged shared-array appends, premature merge before
   gap check, verification writes to shared OS path); §Relation
   to other documents updated to cite isolation_root.

4. parallelization-patterns.md — one-clause cross-reference added
   to the §Phase applicability summary footnote. Substantive
   Pattern C content stays in cluster-parallelism.md per
   CLAUDE.md §5 (do not split SoT across multiple files); the plan
   originally proposed the substantive edit in parallelization-
   patterns.md, but on read of the existing cross-reference
   structure (parallelization-patterns.md L124-L131 explicitly
   delegates Pattern C discipline to cluster-parallelism.md), that
   placement would have created the SoT drift CLAUDE.md §5 warns
   against. Substantive edit relocated to the canonical SoT.

CHANGELOG.md and CHANGELOG.json updated under [Unreleased].

Tool-agnostic check: no vendor / model / framework / product names
introduced. Worktree / container / scoped filesystem view named as
capability categories with bridge-layer implementation deferred.

https://claude.ai/code/session_01LfypX8MN6jAZdtaYwUUdpr
The phrase "agent loop" appeared in four canonical files
(runtime-hook-contract.md, ci-cd-integration-hooks.md,
throughput-first-merge-philosophy.md, diagrams.md) as if defined,
but no glossary entry pinned the term. Closes the dangling-term
gap so consumers cite a single canonical definition rather than
implying their own.

Adds:

1. docs/glossary.md §Process terms — new term "Agent loop" inserted
   before "Sub-agent invocation". Defines the runtime cycle (read
   context → emit action → observe result → repeat); names what
   binds normatively (phase progression, evidence emission, hook
   firing, role boundaries) versus what is bridge-layer (event-
   driven vs polling, single-threaded vs concurrent, sync vs async
   tool dispatch); enumerates termination triggers (stop conditions,
   iteration caps, Tree D escalation, runtime-imposed boundaries);
   classifies the loop-as-clock failure mode (fire delegation →
   end turn → wait for tick → fire again) as the central pattern
   D3 and anti-entropy-discipline.md "Sweep agent runs 24/7" reject
   from opposite directions.

2. skills/engineering-workflow/references/long-running-delegation.md
   — new §Mapping the runtime loop to phase boundaries section
   between §Capability-category mapping and §Anti-patterns. Four
   sub-points:
     - where loop iterations meet phase boundaries (phase advance
       = one iteration; intra-phase iterations fire Category B/C
       hooks but do not change phase)
     - where D2 writes happen on a loop tick (two loops, one shared
       artifact path; never one loop polling the other agent)
     - termination triggers in priority order (stop conditions →
       iteration caps as DIAGNOSTIC budgets not compute budgets →
       Tree D → runtime-imposed boundaries)
     - explicit loop-as-clock anti-pattern callout, symmetric with
       anti-entropy-discipline.md and ai-operating-contract.md §11

3. Back-pointers added to each of the four consuming files, one
   inline parenthetical link per file on the first significant
   mention. Per CLAUDE.md §5, term changes propagate to all
   consumers in the same change. No substantive prose changed in
   the consuming files; only the dangling-term references resolved.

Tool-agnostic check: no vendor / model / framework / product names
introduced. Loop semantics named as capability categories
(event-driven vs polling, sync vs async dispatch).

CHANGELOG.md and CHANGELOG.json updated under [Unreleased].

https://claude.ai/code/session_01LfypX8MN6jAZdtaYwUUdpr
Adds docs/multi-agent-handoff.md §Where inter-agent communication
is recorded — a routing table inserted between §Field read/write
ownership matrix and §Tool-permission matrix.

The field-ownership matrix already declares WHO may write each
field. The new routing table declares WHICH field carries each
shape of inter-agent communication, so a reader following a
send-back, a discovery return, or an escalation can locate the
binding artifact without reconstructing the routing per change.

Channels indexed (existing fields and rules only):
  - Working brief at spawn time → Task Prompt (six columns)
  - Implementation delta from plan → implementation_notes[*]
    with type: planner_disagreement (Tier 1 annotate)
  - Implementation discovery return → phase reversion +
    implementation_notes[*] with type: discovery (Tier 2)
  - Phase 4 record + evidence → manifest as state snapshot
  - Review send-back → review_notes[*] + phase reversion
  - Reviewer's reference-existence challenge → review_notes[*]
    cite + Implementer's reproduction in implementation_notes[*]
  - Specialist audit finding → parallel_groups[*].synthesis
  - Cluster-scoped completion / discovery → implementation_clusters
    [*].status transition + cluster_id-tagged implementation_notes
  - Supersede act → new manifest with supersedes (Tier 3)
  - Escalation requiring human → escalations[*], waivers[*]
  - Outbound briefing → handoff_narrative + residual_risk +
    next_action
  - Long-running sub-agent mid-flight progress → D2 working-space
    path (not a manifest field until promoted)
  - Supervision keep/discard/stop → Tier-2 project-memory
    supervision log (referenced via parallel_groups[*]
    .supervision_log_ref when declared)
  - Sign-off → approvals[*]

No new artifact type, no new schema field, no new evidence enum
introduced — the channels exist; only the index was missing. Each
row's "binding rule" column points back to the canonical source
per CLAUDE.md §5 (do not redefine in another file).

Includes explicit §What this table is not callout: the table is
NOT a license to introduce a free-form conversation log. Every
channel listed has a structured field with an owner and a binding
rule that defines its lifecycle; bundling them into a single flat
artifact would erase the field decomposition the schema is built
on. The entry deliberately closes the door on the "agent dialog
log" proposal that the routing table consolidation might otherwise
appear to invite.

Tool-agnostic check: no vendor / model / framework / product names
introduced. All cited fields are existing schema entries and all
cited rules are existing canonical sections.

CHANGELOG.md and CHANGELOG.json updated under [Unreleased].

https://claude.ai/code/session_01LfypX8MN6jAZdtaYwUUdpr
@EsatanGW EsatanGW merged commit ba906e0 into main Apr 30, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants