Skip to content

Promote main back into dev after coordination release - #159

Merged
joefeser merged 11 commits into
devfrom
integration/promote-main-to-dev-5e7b5ca9778f
Oct 5, 2026
Merged

joefeser merged 11 commits into
devfrom
integration/promote-main-to-dev-5e7b5ca9778f

Conversation

@joefeser

@joefeser joefeser commented Oct 5, 2026 •

Copy link
Copy Markdown
Owner

Source-bound promotion

  • Source ref: origin/main
  • Source snapshot: 5e7b5ca9778fa420be8ad09bb72cab48015e0ec7
  • Target ref: dev
  • Target snapshot at creation: 6de6a8b052199bc45f12882b9aa69503c7f73b88
  • Relationship: dev is a strict ancestor of the source snapshot; this PR is a fast-forward-equivalent reconciliation through the protected branch lane.

This branch is pinned to the merged main snapshot above. Later main commits are not included automatically.

No new product changes are introduced beyond the commits already merged to main by PR #158.

Summary by Sourcery

Harden coordination synchronization and onboarding against unsafe, oversized, inconsistent, or unauthorized state while preserving recoverable exports and typed failures.

New Features:

  • Add server-owned origin-to-project authorization for coordination record admission and validate task/work-receipt relationships during pull.
  • Provide lock-stable kickoff pack export and bounded onboarding and synchronization state handling.

Bug Fixes:

  • Prevent deeply nested or non-canonical JSON, unsafe files, oversized state, interrupted projections, and malformed history from causing crashes or advancing synchronization state.
  • Expand credential detection to cover additional token formats and authorization schemes.

Enhancements:

  • Strengthen coordination synchronization with fail-closed project authorization, bounded reads and writes, typed canonicalization errors, immutable-file safety checks, and legacy hub configuration migration.
  • Improve platform fixture isolation from ambient Git templates, hooks, and configuration.

Documentation:

  • Document synchronization evidence limits, project authorization requirements, kickoff export locking, and onboarding state size constraints.

Tests:

  • Add coverage for resource limits, recursive JSON, canonicalization failures, authorization boundaries, projection recovery, history validation, and isolated repository fixtures.

@sourcery-ai

sourcery-ai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This promotion reconciles main into dev and carries the coordinated release’s security and robustness changes: bounded and fail-closed file/JSON processing, explicit origin-to-project authorization, relationship-aware sync validation, lock-stable kickoff export, recoverable projection publication, stricter schema and credential checks, and isolated conformance fixtures. No new product behavior is introduced beyond the commits already merged to main by PR #158.

Sequence diagram for lock-stable kickoff export

sequenceDiagram
    participant CLI
    participant Kickoff as open_kickoff_pack
    participant Snapshot as authorized_coordination_snapshot
    participant Renderer as render_kickoff_prompt
    participant Stdout

    CLI->>Kickoff: open_kickoff_pack(vault, project, repo_root)
    Kickoff->>Snapshot: authorized_coordination_snapshot(vault)
    Snapshot-->>Kickoff: authorized snapshot and lock
    Kickoff-->>CLI: kickoff pack
    CLI->>Renderer: render_kickoff_prompt(pack)
    Renderer-->>CLI: prompt or JSON receipt
    CLI->>Stdout: print and flush output
    CLI-->>Snapshot: release authorization lock
Loading

Sequence diagram for relationship-aware pull validation

sequenceDiagram
    participant Hub
    participant Client
    participant Validator
    participant Storage

    Hub->>Client: pull response with TaskPackets and WorkReceipts
    Client->>Validator: _validate_pull_record_relationships(by_pair)
    Validator->>Validator: current_coordination_task_leaves(tasks)
    Validator-->>Client: validated exact task, project, label, and writer relationships
    Client->>Storage: apply_pull_response(response)
    Storage-->>Client: advance sync state
Loading

Flow diagram for bounded fail-closed coordination reads

flowchart TD
    A[Read local coordination artifact] --> B{Regular file and within byte limit?}
    B -- No --> C[Reject with typed validation failure]
    B -- Yes --> D[Check JSON nesting depth]
    D --> E{Depth supported?}
    E -- No --> C
    E -- Yes --> F[Decode and validate JSON]
    F --> G{Valid canonical artifact?}
    G -- No --> C
    G -- Yes --> H[Use artifact without advancing state on failure]
Loading

Flow diagram for recoverable projection publication

flowchart TD
    A[Push local coordination pairs] --> B[Write receipt and membership manifest]
    B --> C{Both projection files durable?}
    C -- No --> D[Ignore incomplete historical projection]
    D --> A
    C -- Yes --> E[Acknowledge admitted pairs]
    E --> F[Advance current sync marker]
    C -- Unsafe or oversized --> G[Fail closed without advancing state]
Loading

File-Level Changes

Change Details Files
Hardens coordination and repository JSON handling against recursion, oversized input, unsafe files, and canonicalization failures.
  • Adds bounded reads and explicit nesting checks before parsing persisted coordination, onboarding, projection, hub, and repository data.
  • Translates recursion and canonicalization errors into typed validation or sync diagnostics.
  • Bounds immutable-file comparisons and preserves fail-closed behavior for unsafe or conflicting storage.
artifact_memory/cli.py
artifact_memory/coordination.py
artifact_memory/coordination_onboarding.py
artifact_memory/coordination_sync.py
artifact_memory/repo_identity.py
artifact_memory/coordination_kickoff.py
Strengthens server-bound project authorization and coordination-history validation.
  • Adds server-owned origin-to-project mappings with legacy migration restricted to explicit hub reconfiguration.
  • Checks origin provenance and effective read permissions before admission, returning unauthorized-project for disallowed submissions.
  • Validates pulled WorkReceipt relationships against exact current TaskPacket leaves and prevents invalid histories from advancing state.
artifact_memory/coordination_sync.py
artifact_memory/coordination_outbox_conformance.py
artifact_memory/coordination_sync_conformance.py
docs/onboarding/local-coordination-sync-proof.md
docs/contracts/v0-coordination-plane.md
Makes kickoff export atomic with respect to the authorized projection.
  • Introduces a context-managed kickoff-pack opener that holds the projection authorization lock through construction and caller-owned output.
  • Updates the CLI to render, emit, and flush while the lock remains held, while preserving detached snapshots for the legacy builder.
artifact_memory/coordination_kickoff.py
artifact_memory/cli.py
docs/onboarding/coordination-kickoff.md
tests/test_coordination_kickoff.py
Adds resource limits and transactional recovery semantics for onboarding and synchronization state.
  • Enforces per-artifact byte limits before decoding and before writing onboarding state.
  • Treats incomplete historical projection publication as unacknowledged so retries resubmit idempotently until complete evidence exists.
  • Documents and tests bounded state, interruption recovery, projection integrity, and typed failure behavior.
artifact_memory/coordination_onboarding.py
artifact_memory/coordination_sync.py
docs/decisions/0031-bootstrap-coordination-projects-from-server-bound-labels.md
tests/test_coordination_onboarding.py
tests/test_coordination_sync.py
tests/test_coordination_http.py
Tightens schema constraints, fixture isolation, and credential detection coverage.
  • Adds early max-item enforcement for bounded arrays and expands schema limits for coordination paths and project sets.
  • Creates synthetic Git repositories without ambient templates, hooks, or configuration.
  • Expands session-ledger detection for authorization headers and additional token prefixes.
artifact_memory/schemas/core/coordination-access-label.v0.schema.json
artifact_memory/schemas/core/coordination-kickoff-pack.v0.schema.json
artifact_memory/schemas/core/coordination-kickoff-pack.v1.schema.json
artifact_memory/schemas/core/coordination-task-packet.v0.schema.json
artifact_memory/validator.py
artifact_memory/platform_matrix.py
artifact_memory/session_ledger.py
tests/test_validator.py
tests/test_platform_matrix.py
tests/test_session_ledger.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Reconcile the reviewed coordination release from main into dev

🐞 Bug fix ✨ Enhancement 🧪 Tests 📝 Documentation 🕐 40+ Minutes

Grey Divider

AI Description

• Promote the pinned main snapshot into dev, preserving the changes reviewed in PR #158.
• Carry forward hardened sync admission, bounded state reads, pull validation, and kickoff export.
• Include regression tests and contract updates; introduce no changes beyond the promoted snapshot.
Diagram

graph TD
  H["Hub Policy"] --> S["Sync Adapter"] --> V["Pull Validation"] --> P["Authorized Projection"] --> K["Kickoff Export"]
  L["Vault Records"] --> S
  O["Onboarding"] --> S
Loading
High-Level Assessment

Use the pinned, fast-forward-equivalent promotion: it preserves the reviewed main history without reimplementing or cherry-picking coordination changes. The protected-branch PR provides the requested reconciliation lane.

Files changed (29) +1784 / -186

Enhancement (1) +37 / -5
coordination_kickoff.pyExpose a locked kickoff-pack export context +37/-5

Expose a locked kickoff-pack export context

• Adds a context manager that holds the authorized projection stable through caller-owned export, while retaining the detached pack builder. Reports pack canonicalization failures as validation errors.

artifact_memory/coordination_kickoff.py

Bug fix (7) +709 / -126
cli.pyKeep kickoff export under the projection lock +11/-10

Keep kickoff export under the projection lock

• Renders, emits, and flushes kickoff output while its authorized snapshot remains locked. Converts recursive sync input failures into typed CLI rejections.

artifact_memory/cli.py

coordination.pyBound coordination-file JSON nesting +52/-3

Bound coordination-file JSON nesting

• Checks raw nesting before parsing coordination files and translates read, parse, and validation recursion failures into file-scoped diagnostics.

artifact_memory/coordination.py

coordination_onboarding.pyBound and safely read persisted onboarding artifacts +191/-35

Bound and safely read persisted onboarding artifacts

• Applies artifact-specific byte limits and safe local-file reads to onboarding state, including attempts, checkpoints, publications, and rendered packs. Bounds writes and translates canonicalization failures into typed validation errors.

artifact_memory/coordination_onboarding.py

coordination_sync.pyHarden sync authorization, history checks, and stored-state reads +376/-36

Harden sync authorization, history checks, and stored-state reads

• Requires server-owned origin bindings and effective read permission before submission identity lookup, with a controlled legacy hub-config upgrade path. Validates pulled task and receipt relationships before apply, bounds retained evidence reads, and ignores incomplete historical projections during retry.

artifact_memory/coordination_sync.py

platform_matrix.pyIsolate synthetic Git repository initialization +33/-32

Isolate synthetic Git repository initialization

• Creates platform-probe repositories without ambient Git templates or hooks, using the shared Git invocation helper.

artifact_memory/platform_matrix.py

repo_identity.pyReject excessively nested repository identity JSON +42/-9

Reject excessively nested repository identity JSON

• Checks manifest and committed-identity nesting before parsing and returns typed failures for recursive committed identities and unreadable record files.

artifact_memory/repo_identity.py

session_ledger.pyExpand session-ledger credential detection +4/-1

Expand session-ledger credential detection

• Detects additional GitHub token prefixes and Authorization assignments, including non-Bearer schemes, before ledger ingestion.

artifact_memory/session_ledger.py

Documentation (5) +41 / -4
private_vault_onboarding_slice.pyIdentify governing onboarding safety sources +2/-0

Identify governing onboarding safety sources

• Adds comments linking safety categories to the repository boundary and onboarding decision.

artifact_memory/private_vault_onboarding_slice.py

v0-coordination-plane.mdDocument coordination validation limits +10/-1

Document coordination validation limits

• Records the pending-outcome byte limit and the 1,000-entry ceilings for scope paths and AccessLabel project sets.

docs/contracts/v0-coordination-plane.md

0031-bootstrap-coordination-projects-from-server-bound-labels.mdDocument onboarding artifact byte limits +8/-0

Document onboarding artifact byte limits

• Specifies bounded retained reads and writes for onboarding artifacts and their typed oversized-state failure.

docs/decisions/0031-bootstrap-coordination-projects-from-server-bound-labels.md

coordination-kickoff.mdDocument locked kickoff exports +6/-0

Document locked kickoff exports

• Explains how CLI and library callers hold authorization stable through pack output.

docs/onboarding/coordination-kickoff.md

local-coordination-sync-proof.mdDocument origin admission and interrupted-sync recovery +15/-3

Document origin admission and interrupted-sync recovery

• Describes server-owned origin bindings, read-permission admission, and retry behavior when historical projection publication is incomplete.

docs/onboarding/local-coordination-sync-proof.md

Other (16) +997 / -51
coordination_outbox_conformance.pyProvision origin policy in outbox conformance +1/-0

Provision origin policy in outbox conformance

• Supplies an explicit origin-to-project binding for the synthetic hub fixture.

artifact_memory/coordination_outbox_conformance.py

coordination_sync_conformance.pyAssert record-bound admission outcomes +18/-2

Assert record-bound admission outcomes

• Configures explicit fixture origin policy and checks submission codes against the conformance vector before evaluating pull behavior.

artifact_memory/coordination_sync_conformance.py

coordination-access-label.v0.schema.jsonCap AccessLabel project permission arrays +6/-6

Cap AccessLabel project permission arrays

• Limits each grant and denial project array to 1,000 entries.

artifact_memory/schemas/core/coordination-access-label.v0.schema.json

coordination-kickoff-pack.v0.schema.jsonCap v0 kickoff scope path arrays +2/-2

Cap v0 kickoff scope path arrays

• Limits allowed and forbidden path arrays in v0 kickoff packs to 1,000 entries each.

artifact_memory/schemas/core/coordination-kickoff-pack.v0.schema.json

coordination-kickoff-pack.v1.schema.jsonCap v1 kickoff scope path arrays +2/-2

Cap v1 kickoff scope path arrays

• Applies the same 1,000-entry path-array ceiling to v1 kickoff packs.

artifact_memory/schemas/core/coordination-kickoff-pack.v1.schema.json

coordination-task-packet.v0.schema.jsonCap TaskPacket scope fence paths +2/-2

Cap TaskPacket scope fence paths

• Limits allowed and forbidden TaskPacket paths to 1,000 entries each.

artifact_memory/schemas/core/coordination-task-packet.v0.schema.json

vectors.jsonAlign conformance expectations with hardened admission +3/-2

Align conformance expectations with hardened admission

• Adds the expected unauthorized-project submission code and adjusts exclusion and oversized-record expectations.

fixtures/coordination-sync/v0/vectors.json

test_coordination.pyTest bounded record arrays and recursive JSON diagnostics +61/-0

Test bounded record arrays and recursive JSON diagnostics

• Covers scope path and AccessLabel project-set ceilings and verifies typed CLI rejection of deeply nested coordination JSON.

tests/test_coordination.py

test_coordination_freshness.pyTest recursive committed repository identity rejection +27/-0

Test recursive committed repository identity rejection

• Verifies that deeply nested identity content in Git history produces a typed freshness mismatch.

tests/test_coordination_freshness.py

test_coordination_http.pyTest HTTP recovery and recursive CLI input +40/-0

Test HTTP recovery and recursive CLI input

• Checks retry after interrupted projection publication and typed rejection of a recursive access-label reference.

tests/test_coordination_http.py

test_coordination_kickoff.pyTest locked export and kickoff validation failures +89/-4

Test locked export and kickoff validation failures

• Proves a concurrent pull cannot change scope during build, render, write, or flush. Covers canonicalization diagnostics and retains independent validation of previously admitted task forks.

tests/test_coordination_kickoff.py

test_coordination_onboarding.pyTest onboarding byte bounds and canonicalization errors +179/-0

Test onboarding byte bounds and canonicalization errors

• Exercises per-artifact persisted-state limits and typed canonicalization failures in validators and CLI output.

tests/test_coordination_onboarding.py

test_coordination_sync.pyCover sync admission, bounds, migration, and recovery +505/-29

Cover sync admission, bounds, migration, and recovery

• Adds adversarial coverage for origin policy, write-only submissions, malformed history, bounded reads, immutable collisions, interrupted projections, and explicit legacy hub-config migration.

tests/test_coordination_sync.py

test_platform_matrix.pyTest isolation from ambient Git hooks +41/-1

Test isolation from ambient Git hooks

• Verifies that synthetic repository setup ignores configured external templates and hooks.

tests/test_platform_matrix.py

test_session_ledger.pyTest expanded credential rejection +9/-1

Test expanded credential rejection

• Covers additional GitHub token prefixes and Bearer, Basic, and Digest Authorization values.

tests/test_session_ledger.py

test_validator.pyAssert array limits precede uniqueness checks +12/-0

Assert array limits precede uniqueness checks

• Verifies that an oversized array fails before the validator performs unique-item comparisons.

tests/test_validator.py

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Fixed security issues:

  • Command injection from untrusted input passed to OS command execution (link)
Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="artifact_memory/coordination_sync.py" line_range="2651-2670" />
<code_context>
+        record
</code_context>
<issue_to_address>
**Valid receipts fail without task visibility**

When a principal has permission to sync WorkReceipts but not TaskPackets, and the pull contains an authorized WorkReceipt whose task is therefore absent, `_validate_pull_record_relationships` requires every WorkReceipt’s exact TaskPacket to appear in the pulled membership. A label can grant `syncWorkReceipts` without granting `syncTaskPackets`, so an otherwise authorized receipt-only response is rejected and the caller cannot complete sync.

Either require the TaskPacket grant whenever WorkReceipt sync is granted, or validate receipts without requiring the caller to receive a task it is not authorized to access.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and this changes the authorization and trust-boundary logic for coordination-record admission, including server-owned origin-to-project mapping and read-permission checks. If that policy is wrong, records may be admitted or exposed incorrectly from the moment it ships, and reverting would not undo immutable records or projections already created.

Blocking findings: artifact_memory/coordination_sync.py:2670


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread artifact_memory/coordination_sync.py
@qodo-code-review

qodo-code-review Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (5) 📘 Rule violations (1) 🔗 Cross-repo conflicts (0) 📜 Skill insights (0)

Grey Divider


Remediation recommended

1. Reconfiguring a hub silently drops its origin policy 🐞 Bug ≡ Correctness
Description
When configure_local_hub gets no origin_projects, it builds a mapping from the labels' own
originId and single-project projectNames, then overwrites hub-config.json without checking the
explicit mapping already stored there. A routine rebinding or scope-generation bump that leaves the
argument out replaces a configured multi-origin policy with a derived (often empty) one, and every
later push from those origins is rejected as unauthorized-project.
Code

artifact_memory/coordination_sync.py[R1006-1010]

+    if origin_projects is None:
+        # Backward-compatible single-project fixture setup. The caller still
+        # owns this administrative configuration; ambiguous multi-project
+        # labels derive no origin binding and therefore fail admission closed.
+        derived: dict[str, str] = {}
Relevance

●●● Strong

Silent replacement of server-owned origin policy can revoke valid submissions during
reconfiguration.

PR-#143

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The derivation runs whenever the argument is None (1006-1030). The reconfiguration branch loads
prior_config but only compares hub_id and scope_generation (1051-1060), then writes the new
config unconditionally (1079). Admission depends only on config["origin_projects"] (1394, 2018,
2029). The conformance wrapper has to inject ORIGIN_PROJECTS through setdefault so its own
reconfigurations do not lose the mapping, which shows how easy this is to hit.

artifact_memory/coordination_sync.py[1006-1030]
artifact_memory/coordination_sync.py[1043-1079]
artifact_memory/coordination_sync.py[1394-1395]
artifact_memory/coordination_sync_conformance.py[46-49]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
`configure_local_hub` derives `origin_projects` whenever the caller omits it, and writes the result over an existing hub's explicit mapping. Reconfiguration can therefore silently revoke origin admission.

## Fix Focus Areas
- artifact_memory/coordination_sync.py[1006-1079]

## Recommended Fix
Inside the configuration lock, when `origin_projects` was not supplied and a prior config exists that has `origin_projects`, reuse the prior mapping (or raise `hub-config-invalid` and require an explicit mapping). Run the label-based derivation only for a brand-new hub or a legacy config that has no mapping. Add a test that reconfigures without `origin_projects` and confirms the earlier mapping survives.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


2. Reviewers miss impact disclosures 📘 Rule violation § Compliance
Description
The pull request description lists source and coordination changes but contains no explicit
security-impact or compatibility-impact statement. Because the description omits both required
disclosures, reviewers cannot determine whether the new credential-bound sync and onboarding changes
introduce security or compatibility consequences.
Code

artifact_memory/coordination.py[R34-37]

+def _check_coordination_json_depth(data: bytes) -> None:
+    """Reject excessive JSON nesting consistently across Python runtimes."""
+    depth = 0
+    in_string = False
Relevance

●●● Strong

Explicit compliance disclosure requirements favor acceptance, especially for security-sensitive
coordination behavior.

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The supplied pull request description describes coordination changes and commits but contains no
explicitly labeled security-impact or compatibility-impact discussion. The changed coordination
validation code demonstrates that the PR includes substantive behavior changes requiring those
disclosures.

Rule 3181010: Document security and compatibility impact in pull request descriptions
artifact_memory/coordination.py[34-37]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The pull request description does not explicitly address security or compatibility impact, even though the change modifies coordination validation, synchronization, and onboarding behavior.

## Fix Focus Areas
- artifact_memory/coordination.py[34-37]

## Recommended Fix
Add clearly labeled `Security impact` and `Compatibility impact` sections to the pull request description. State the relevant risks, behavior changes, migration requirements, and explicitly say when no impact is known.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


3. Large sync histories break future pulls 🐞 Bug ☼ Reliability
Description
_apply_verified_pull writes the complete authorized-membership manifest without an aggregate size
check, but the new MAX_MEMBERSHIP_MANIFEST_BYTES limit rejects that same file when it is read
again. Once a schema-valid history contains enough pairs to exceed 8 MiB, a pull can install its
success marker and later pulls and authorized-projection reads fail on the projection it created.
Code

artifact_memory/coordination_sync.py[73]

+MAX_MEMBERSHIP_MANIFEST_BYTES = MAX_REQUEST_BYTES
Relevance

●●● Strong

Writers and readers must enforce compatible aggregate limits; prior resource-boundary hardening was
accepted.

PR-#79

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The writer serializes all authorized pairs into one file, while both current and historical readers
impose the new 8 MiB limit; page limits constrain individual response pages, not this aggregate
file.

artifact_memory/coordination_sync.py[2559-2582]
artifact_memory/coordination_sync.py[2434-2455]
artifact_memory/coordination_sync.py[1637-1658]
artifact_memory/coordination_sync.py[2235-2235]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A complete, valid authorized membership can exceed the new read limit because its writer does not enforce that limit.
## Fix Focus Areas
- artifact_memory/coordination_sync.py[70-74]
- artifact_memory/coordination_sync.py[2434-2455]
- artifact_memory/coordination_sync.py[2559-2568]
## Recommended Fix
Define a supported bound for total authorized membership and enforce it before writing a projection or advancing the marker; alternatively use a bounded, paginated manifest representation that both writer and readers support. Test a history crossing the current 8 MiB threshold.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


4. Long project names strand onboarding 🐞 Bug ☼ Reliability
Description
_onboard_project_locked applies the new 1 MiB kickoff-pack limit only after it has retained an
onboarding attempt and sync checkpoint and completed sync. A schema-valid humanName can fit the
attempt yet make the larger generated pack exceed that limit, so retries recover the same checkpoint
and fail at the same pack-size check.
Code

artifact_memory/coordination_onboarding.py[1310]

+    pack_bytes = _bounded_onboarding_bytes(pack, MAX_ONBOARDING_PACK_BYTES)
Relevance

●●● Strong

Persisting retry state before an unrecoverable pack limit can strand onboarding; reliability
findings of this type are accepted.

PR-#79
PR-#143

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The identity schema has no maximum name length; the attempt and sync checkpoint are persisted before
pack construction, and the pack has its own 1 MiB check with no completed publication to resume.

artifact_memory/schemas/coordination/repo-identity.v0.schema.json[8-13]
artifact_memory/coordination_onboarding.py[558-571]
artifact_memory/coordination_onboarding.py[1150-1192]
artifact_memory/coordination_onboarding.py[1222-1230]
artifact_memory/coordination_onboarding.py[1295-1310]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A project name can pass identity validation and be persisted before a generated kickoff pack fails its newly imposed size bound.
## Fix Focus Areas
- artifact_memory/coordination_onboarding.py[1054-1103]
- artifact_memory/coordination_onboarding.py[1150-1192]
- artifact_memory/coordination_onboarding.py[1295-1310]
## Recommended Fix
Reject names that would exceed generated onboarding artifact limits before creating repository identity, retaining an attempt, or syncing. Apply the same preflight to an existing identity before starting a new onboarding attempt, and test retry behavior.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


5. Onboarded projects cannot submit records 🐞 Bug ≡ Correctness
Description
configure_local_hub leaves origin_projects empty for a multi-project label, while project
registration still offers its readable projects for onboarding. After onboarding succeeds,
_submission_policy_code rejects records from that origin as unauthorized-project, including when
the label grants the project read and sync permissions.
Code

artifact_memory/coordination_sync.py[R1013-1015]

+            projects = label.get("projectNames") if isinstance(label, dict) else None
+            if isinstance(projects, list) and len(projects) == 1:
+                project = projects[0]
Relevance

●● Moderate

Multi-project ambiguity may intentionally fail closed under server-owned origin policy, but
onboarding and submission behavior appears inconsistent.

PR-#143

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
Default configuration derives a mapping only from labels naming exactly one project; registration
independently selects readable projects, but push requires an exact configured origin mapping.

artifact_memory/coordination_sync.py[1006-1037]
artifact_memory/coordination_sync.py[1126-1156]
artifact_memory/coordination_onboarding.py[1068-1103]
artifact_memory/coordination_sync.py[1393-1400]
artifact_memory/coordination_sync.py[2013-2029]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
A multi-project label can produce a successful onboarding binding even though its origin has no admission mapping, so subsequent submissions are rejected.
## Fix Focus Areas
- artifact_memory/coordination_sync.py[1006-1037]
- artifact_memory/coordination_sync.py[1126-1156]
- artifact_memory/coordination_sync.py[1393-1400]
## Recommended Fix
Make project registration reject or omit projects that cannot be submitted under the configured origin-to-project policy. Preserve fail-closed admission for ambiguous origins and test onboarding followed by a submission.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗



Informational

6. Changed retirement evidence reports the wrong error 🐞 Bug ◔ Observability
Description
_remove_exact_active_evidence now reads the active file with maximum_bytes=len(expected_bytes)
through _read_onboarding_bytes, so an active attempt or checkpoint that grew raises
onboard-state-too-large instead of onboard-state-conflict. A file that disappears between the
existence check and the read now raises onboard-state-incomplete. Operators recovering an
interrupted retirement get a size-limit or incomplete-state diagnostic for what is really concurrent
modification of active evidence.
Code

artifact_memory/coordination_onboarding.py[R671-678]

+    expected_bytes = _canonical_onboarding_bytes(expected)
+    raw = _read_onboarding_bytes(
+        vault,
+        path,
+        maximum_bytes=len(expected_bytes),
+        missing_code="onboard-state-incomplete",
+    )
+    if raw != expected_bytes:
Relevance

●●● Strong

Bounded reads should preserve concurrent-modification diagnostics; similar TOCTOU and typed-error
hardening was accepted.

PR-#103
PR-#79

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
_read_onboarding_bytes raises onboard-state-too-large when the bounded read returns more than
maximum_bytes, and re-raises the missing code on FileNotFoundError. Because maximum_bytes equals
the expected length, any larger file never reaches the raw != expected_bytes comparison that
raises onboard-state-conflict.

artifact_memory/coordination_onboarding.py[265-295]
artifact_memory/coordination_onboarding.py[658-682]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
Retiring active onboarding evidence that changed size raises `onboard-state-too-large` rather than `onboard-state-conflict`.

## Fix Focus Areas
- artifact_memory/coordination_onboarding.py[671-682]

## Recommended Fix
Wrap the `_read_onboarding_bytes` call and re-raise `onboard-state-too-large` (and, if wanted, `onboard-state-incomplete`) as `ValidationFailure("onboard-state-conflict", "active onboarding evidence changed before retirement")`, keeping the bounded read.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools

Dismiss ↗ | View ↗


Grey Divider

Context sources
✅ Compliance rules (platform): 18 rules
✅ Cross-repo context — repo relationships
  Explored: repo: joefeser/what-is-the-spec (sha: 2a288b6a) — View relationship
Review mode: Auto: 🧠 Deep: Broad security-sensitive coordination changes span many independent logic paths and files.

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread artifact_memory/coordination.py
Comment thread artifact_memory/coordination_sync.py
Comment thread artifact_memory/coordination_sync.py
Comment thread artifact_memory/coordination_onboarding.py
Comment thread artifact_memory/coordination_sync.py
Comment thread artifact_memory/coordination_onboarding.py
@joefeser
joefeser merged commit a3798d0 into dev Oct 5, 2026
7 checks passed
@joefeser
joefeser deleted the integration/promote-main-to-dev-5e7b5ca9778f branch October 5, 2026 22:30
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.

1 participant