Skip to content

manifest-bootstrap.ps1 accepts stale platform_project on resume #166

Description

@PolyphonyRequiem

manifest-bootstrap.ps1 accepts stale platform_project on resume

Summary

.conductor/registry/scripts/manifest-bootstrap.ps1 validates that
an existing .polyphony/run.yaml matches the current invocation by
comparing only root_id. The platform_project field is read
from the manifest and used as the new manifest's value, but it is
not validated against the live invocation's --Organization /
--Project arguments.

Net effect: if a manifest was created against project A and then
re-used for an invocation against project B (e.g. a worktree was
checked out from project A's run but the operator's twig context now
points to project B), the bootstrap silently accepts the manifest
without warning.

Concrete case

Today's polyphony-3043 worktree's manifest still carries
platform_project: dev.azure.com/IntentionalSoftware/IntentionalEngineeringSystem
from an audit-time test invocation. Re-running the apex driver from
the same worktree against a different --Project value would not
produce an error — the bootstrap would re-emit the same manifest.

Proposal

Add platform_project drift validation to manifest-bootstrap.ps1:

  1. When an existing manifest is read, compute the expected
    platform_project from the invocation arguments
    (--Organization + --Project, lowercased + normalized to the
    same dev.azure.com/{org}/{project} form the bootstrap already
    uses).
  2. Compare to the manifest's stored platform_project.
  3. On mismatch: emit a routing-style error envelope with
    error_code: manifest_platform_project_mismatch, including both
    values for the operator to disambiguate.

Out of scope

  • Auto-rewriting the manifest. Mismatch is a warning sign; operator
    should explicitly delete the manifest or move worktrees, not have
    the script silently re-stamp it.

Acceptance

  • New error code documented in docs/polyphony-state-effects-catalog.md
    under §manifest-bootstrap.ps1.
  • Pester test in manifest-bootstrap.Tests.ps1 reproducing the
    mismatch and asserting the new error envelope.
  • Routing-style envelope shape preserved (always exit 0 + JSON).

Lineage

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

    bugSomething isn't workingpolyphony-followupFollow-up from a shipped PR

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions