fix(sync): enforce protected approved alias policy#1991
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Pre-fix investigation
|
Strict TDD evidenceRed commit pushed first: Red command: Red result: Green implementation: Post-rebase verification: focused alias/path/snapshot/transaction/reporting pytest suite, pylint for touched production modules (10.00/10), and |
E2E and parity evidence
It returned
|
|
Rebased locally onto origin/codex/issue-1932-verifiable-goal at f78bad5. Local rebased head: e742141. Validation: git diff --check passed; focused suite had 42 passed, 1 failed in tests/test_sync_core_transaction.py::test_descriptor_time_parent_symlink_swap_cannot_redirect_commit. The behavior still raises TransactionConflict, but the foundation changes its message to 'destination alias policy changed: src/widget.py' rather than the test's expected 'parent changed or is unsafe'. Per no-feature-edits, this branch was not pushed; worktree is clean. |
|
Post-rebase blocker acknowledged: I am updating only the affected descriptor-time parent-symlink-swap assertion to accept the legitimate protected-path conflict outcome, then will run focused alias/transaction tests and push the rebased stack with force-with-lease. |
df8e057 to
44a3434
Compare
|
Resolved in 44a3434 ( |
44a3434 to
226c480
Compare
Codex xhigh adversarial review — PR #1991 @ 226c480Verdict: DON'T MERGE P1 (blocking)
P2 (non-blocking)
Notes
|
Implementer response to Codex reviewP1 #1: Approved alias policy is consumed but not accounted as protected inventoryStatus: FIXING P2 #1: Recovery can adopt alias authority from the local WAL without reloading protected policyStatus: FIXING P2 #2: Transaction plans do not reject duplicate canonical destinationsStatus: FIXING |
|
To use Codex here, create an environment for this repo. |
Follow-up fix evidenceFixed Codex xhigh findings from #1991 (comment). Commits:
Verification:
|
2519671 to
688ea85
Compare
Codex xhigh adversarial re-review — PR #1991 @ 688ea85Verdict: DON'T MERGE P1 (blocking)
P2 (non-blocking)
Prior findings verified
Notes
|
Re-review follow-up evidenceFixed latest xhigh re-review findings from #1991 (comment). Commits:
Verification:
Branch pushed; no merge performed. |
0fceb48 to
66b5464
Compare
Codex xhigh adversarial re-review round 3 — PR #1991 @ 66b5464Verdict: DON'T MERGE P1 (blocking)
P2 (non-blocking)
Prior Findings Verified
Notes
|
Implementer response to Codex re-review round 3P1 #1: Overlapping approved aliases can still hide unowned candidate filesStatus: FIXING P2 #1: Alias and canonical transaction commits do not share a canonical destination lockStatus: FIXING |
|
To use Codex here, create an environment for this repo. |
Round-3 follow-up evidenceFixed latest xhigh re-review findings from #1991 (comment). Commits:
Verification:
Branch pushed; no merge performed. |
b846c74 to
2b9f0e7
Compare
Codex xhigh adversarial re-review round 4 — PR #1991 @ 2b9f0e7Verdict: DON'T MERGE P1 (blocking)
P2 (non-blocking)
Prior Findings Verified
Read-only Probes
Notes
|
Implementer response to Codex re-review round 4P1 #1: Manifest/reporting still accepts overlapping approved aliases and hides unowned candidate filesStatus: FIXING |
|
To use Codex here, create an environment for this repo. |
Round-4 follow-up evidenceFixed latest xhigh re-review finding from #1991 (comment). Commit:
TDD evidence:
Verification:
Branch pushed; no merge performed. |
dfa00cb to
e7c718c
Compare
Codex xhigh adversarial re-review round 5 — PR #1991 @ e7c718cVerdict: MERGE P1 (blocking)
P2 (non-blocking)
Prior Findings Verified
Read-only Probes
Notes
|
e7c718c to
275b67d
Compare
Codex xhigh adversarial re-review round 6 — PR #1991 @ 275b67dVerdict: DON'T MERGE P1 (blocking)
P2 (non-blocking)
Prior Findings Verified
Read-only Probes
Notes
|
bb2a74c to
0fadd2c
Compare
Sol-high combined-base verification — PR #1991 @ 0fadd2cVerdict: REQUEST_CHANGES [P1] Rebase left three Alias fail-closed regressions asserting the obsolete manifest errorFile: The combined foundation's Exact focused rerun:
Smallest correction: Update these three expectations to the foundation's exact fail-closed message (or assert only Verified integration scope
|
Exact-head correction verification — PR #1991 @ 1717b36VERIFIED — MERGE Verified only the prior Alias finding and affected behavior:
Exact-head CI inspection: no failures at review time; Repo Bloat and JS/Actions analysis passed, CodeQL was neutral, while unit tests, smoke, CLI, story, Python analysis, heal, and auto-heal were still in progress. Local/remote/live PR heads match the requested SHA and the worktree is clean. |
…ixes Reconciles this PR's resolver hardening with upstream main advancing to #1991 "enforce protected approved alias policy" (and #1985 global-sync). Only the test file conflicted textually; the semantic reconciliation of sync_determine_operation.py: - Path-qualified ambiguity (R11): a row whose prompt FILENAME does not path-own the (context-stripped) qualified basename no longer inflates the ambiguity count, so a `nested/widget` request with rows `widget_python.prompt`->wrong and `nested/widget_python.prompt`->src resolves uniquely to src instead of raising a false AmbiguousModuleError (#1991 test_sync_classifier_preserves_nested_prompt_alias_identity). - Approved in-repo prompt aliases (#1991): `_walk_prompt_relative_path` now treats a prompt symlink whose target stays inside the enclosing git repository as CONTAINED (lexical alias identity), so R8 discovery AND R6 `_architecture_prompt_owner` recognise the canonical alias; a symlink leaving the repository (or a non-repo tree) is still rejected (R8). Round-10 independent review (gpt-5.6-sol xhigh) fixes: - P1: nested physical prompt identity — the discovered-basename -> template_basename derivation now uses the LEXICAL prompt path anchored at config_anchor, and the template branch uses template_basename, so an outputs `{category}` template maps a nested prompt to src/nested/foo.py (not src/foo.py), CWD-independently. - P2: outputs.prompt.path templates that keep an unexpanded `{placeholder}` or expand to the project root now fail closed (parity with code/example/test). Both units' .pdd/meta fingerprints regenerated with #1991's hashing (stored == recomputed). Validation: 441 resolver tests, 47 #1985/#1991 sync_core + alias-policy tests, 146 path/output/issue-237 tests pass; ruff clean; git diff --check clean. Note (unchanged from prior merge): `pdd sync <unit> --dry-run` reporting the sync_determine_operation unit under the `utils` context is pre-existing #1985 continuous_sync behavior (identical on pure origin/main). test_sync_core_pdd_rollout_policy fails because this PR edits a protected prompt (CONTRACT-SHA256 divergence) — a maintainer re-sign on a non-required check, not a defect. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…template identity (R8/R11/R16) Round-11 independent review (gpt-5.6-sol xhigh) — three defects from the #1991 reconciliation, all fixed: - F1: approved in-repo prompt aliases worked only on the direct fast path; architecture-hint and recursive discovery used the stricter `_prompt_candidate_within_root`, which rejected the same alias for an indirect (bare-basename) request. That predicate is now alias-aware too (an escaping symlink contained inside the enclosing git repository is honored), so ALL discovery paths resolve an approved alias consistently; an out-of-repository symlink is still rejected (R8). R8 doctrine updated. - F2: the R11 filename-ownership filter over-suppressed a genuine ambiguity — two bare `widget_python.prompt` rows mapping `nested/widget` to two distinct nested outputs collapsed to choices=[] and silently fell back. The filter now fires ONLY when a path-owning filename row actually exists; with no owner, every eligible suffix-aligned legacy row is retained so AmbiguousModuleError is raised. - F3: the architecture branch expanded example/test templates with `construct_paths_basename` (`foo`) instead of `template_basename` (`nested/foo`), flattening a nested `{category}` example/test path. It now uses `template_basename`, matching the non-architecture branch. Adds indirect-alias, all-legacy-ambiguity, and arch-nested-category regression tests; R8/R11/R16 coverage updated; fingerprints regenerated (stored == recomputed). Validation: 444 resolver + 47 #1985/#1991 sync_core/alias-policy + 108 path/issue-237 tests pass; ruff clean; git diff --check clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Summary
Test plan
pdd recovercrash-recovery workflow.