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:
- 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).
- Compare to the manifest's stored
platform_project.
- 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
manifest-bootstrap.ps1accepts staleplatform_projecton resumeSummary
.conductor/registry/scripts/manifest-bootstrap.ps1validates thatan existing
.polyphony/run.yamlmatches the current invocation bycomparing only
root_id. Theplatform_projectfield is readfrom the manifest and used as the new manifest's value, but it is
not validated against the live invocation's
--Organization/--Projectarguments.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-3043worktree's manifest still carriesplatform_project: dev.azure.com/IntentionalSoftware/IntentionalEngineeringSystemfrom an audit-time test invocation. Re-running the apex driver from
the same worktree against a different
--Projectvalue would notproduce an error — the bootstrap would re-emit the same manifest.
Proposal
Add
platform_projectdrift validation tomanifest-bootstrap.ps1:platform_projectfrom the invocation arguments(
--Organization+--Project, lowercased + normalized to thesame
dev.azure.com/{org}/{project}form the bootstrap alreadyuses).
platform_project.error_code: manifest_platform_project_mismatch, including bothvalues for the operator to disambiguate.
Out of scope
should explicitly delete the manifest or move worktrees, not have
the script silently re-stamp it.
Acceptance
docs/polyphony-state-effects-catalog.mdunder §
manifest-bootstrap.ps1.manifest-bootstrap.Tests.ps1reproducing themismatch and asserting the new error envelope.
Lineage
manifest-bootstrap.ps1; deferred this validationper the script's docstring).
docs/polyphony-state-effects-catalog.md"Open questions" sectionflags this as known gap.