Skip to content

Enhancement: scope runtime verification to bundle identity and distinguish overlap #32

Description

@netopsengineer

Summary

Make runtime visibility verification identify and validate the selected bundle
independently of module markers used by other loaded bundles. Report duplicate
whole bundles and cross-bundle policy overlap as distinct findings.

Observed behavior

Reproduced with installed agents-md-compiler 1.0.0. The relevant implementation
also matches main at commit ee3c5edd85542c4265cb2f5880082ed54a2dc06b.

The current verifier counts each expected module marker across every string
extracted from prompt-input JSON. Counts greater than one produce
MARKER_DUPLICATED. Although the rendered header records a bundle ID, the
verification search is not bounded to that bundle. Module end markers contain
only the module ID, not the bundle identity or content digest.

Focused in-memory reproduction:

  1. Compile two complete bundles with different bundle IDs that both select the
    same canonical coordination module.
  2. Supply both complete rendered bundles in one synthetic prompt-input string.
  3. Verify the first bundle against that evidence.

Result: CodexVerificationError, reporting that the coordination begin marker
appeared twice. Both bundles were intact. Capability detection and prompt
retrieval were mocked; installed verification logic was exercised unchanged.

There is also a narrower identity collision: separate bundles can reuse a module
ID for different content. Their begin markers can differ while their end markers
remain identical, so globally counting end markers cannot distinguish them.

Why this matters

The verifier conflates three different conditions:

  • The selected bundle is present and complete.
  • The selected bundle itself is loaded more than once.
  • Another bundle shares module IDs or repeats policy content.

These conditions need different diagnostics and remediation. Module reuse across
compositions should not make the verifier unable to identify which bundle passed
or failed verification.

This is not a request to silently approve redundant policy loading. Actual
cross-bundle content duplication should remain visible to the operator.

Proposed enhancement

  • Resolve the selected bundle using its identity and bounded contents before
    evaluating module markers and content.
  • Detect multiple occurrences of the selected bundle separately from overlap
    with another bundle.
  • Distinguish ID reuse with different content from identical shared content.
  • Report cross-bundle policy overlap separately from selected-bundle integrity;
    define explicitly whether overlap is informational, a warning, or a separate
    policy failure.
  • Preserve failure behavior for missing content, malformed boundaries, ambiguous
    identity, and duplicate module occurrences within the selected bundle.

A rendered-format change may or may not be necessary. Do not prescribe one until
bundle selection and compatibility requirements are established. Coordinate this
work with the full-content verification enhancement in #31.

Acceptance criteria

  • A single intact selected bundle passes.
  • An unrelated second bundle does not affect the selected bundle's result.
  • Two bundles reusing a module ID with different content are distinguishable.
  • Two intact bundles sharing a canonical module produce a precise overlap
    diagnostic, not an ambiguous selected-bundle marker-duplication error.
  • Two copies of the selected bundle are explicitly identified as such.
  • Duplicate or missing modules inside the selected bundle remain failures.
  • Tests cover multiple bundles within one instruction string and across
    separately supported instruction fields.

Sources

Marker construction

Occurrence counting and verification

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions