Skip to content

test(source): cover URL re-add and shared-cache ownership - #931

Merged
jeff-r2026 merged 1 commit into
Tencent:mainfrom
NianJiuZst:codex/fix-source-project-manifests
Oct 2, 2026
Merged

jeff-r2026 merged 1 commit into
Tencent:mainfrom
NianJiuZst:codex/fix-source-project-manifests

Conversation

@NianJiuZst

@NianJiuZst NianJiuZst commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Test-only follow-on to #929, which merged into main as e2ca08f. Rebuilt on current main (aabf71c) after the squash merge, retaining only the original 35-line crossover regression in src/__tests__/source-cache-isolation-e2e.test.ts.

The regression exercises the source lifecycle through the built CLI:

  1. Two teams use the same alias for different repository URLs and receive their own content.
  2. Alpha removes its subscription, then re-adds the alias using beta's URL while beta's remote is offline.
  3. Alpha receives beta's cached content without changing beta's installation manifest.
  4. Removing alpha retains beta's deployment, ownership record, shared cache, and last-successful-pull timestamp.
  5. Further failed refreshes preserve that timestamp; removing beta still finds its record and removes its deployment. The unverified legacy copy remains untouched.

Scope and dependency

#929 is already merged, so there is no remaining landing dependency. This PR contains one test commit and changes no runtime code or documentation. Existing nested-path behavior remains inherited from main; skill-data/core/SKILL.md has no diff, honoring the human review request.

The implementation details and its documented safety limits remain in #929 and the existing usage/design documentation.

Verification

Rebased head: 3e776f1, based on aabf71c.

  • Build, typecheck, and lint passed.
  • All 52 real-CLI source tests across 13 files passed, with retries disabled, including the crossover regression and the nested-path ownership cases.
  • Full unit run: 7,148 passed, 22 failed, 1 skipped across 370 files (366 passed, 4 failed).
  • The exact same 22 failures reproduce in those four test files on untouched current main (aabf71c). They are the existing MCP sandbox failures caused by the temporary-root .git marker where the fixtures expect to be outside any repository. No rebased-head-only unit failure remains. This is not an all-green local full-suite result.
npm run build
npm run typecheck
npm run lint
env -u CODEX_HOME GIT_DISCOVERY_ACROSS_FILESYSTEM=1 \
  ./node_modules/.bin/vitest run --config vitest.e2e.config.ts \
  src/__tests__/source-*-e2e.test.ts --retry 0
env -u CODEX_HOME GIT_DISCOVERY_ACROSS_FILESYSTEM=1 \
  ./node_modules/.bin/vitest run --maxWorkers 4

The CLI tests use temporary HOME directories, the Git provider, local bare repositories with HTTPS URL rewrites, and real dist/index.js commands.

Hosted results for 3e776f1

Exact-head CI passed: all six Linux/macOS Node 20/22/24 test lanes, Build, and fork-safe E2E succeeded. Code Erosion and Tencent scan also passed. The credentialed GitHub-provider full-surface job was intentionally skipped for this fork PR.

Automated review reports no findings, and confirms that the earlier skill-documentation concern does not apply to this tests-only diff. The PR is conflict-free and remains open for human re-review; the previous changes-requested review has not yet been superseded.

@jeff-r2026 jeff-r2026 self-assigned this Sep 30, 2026
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown
  • [P1 blocking] src/source.ts:227 — Preserving the clone unconditionally breaks remove-and-readd with the same name. After source remove shared, running source add <different-url> --name shared finds the retained repo/; ensureSourceRepo() only pulls its existing origin and then records the new URL, so subsequent commands deploy content from the old repository. Delete the clone when no other installation records remain, or validate/re-key it by repository URL.

The PR description includes sufficient real-CLI verification for this runtime change.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from c9ea129 to bc6f01e Compare October 1, 2026 08:37
@NianJiuZst NianJiuZst changed the title fix(source): isolate installation manifests by team and destination test(source): cover URL re-add and shared-cache ownership Oct 1, 2026
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the old-URL cache finding by combining the URL-specific cache implementation and scoped installation manifests in #929. This branch now includes that complete fix and adds a focused CLI regression: remove alpha, re-add the same alias with beta's URL while alpha's old clone remains, then remove alpha again while beta shares the cache and its remote is offline. The test verifies beta's content, manifest, cache, cleanup, and unchanged successful-pull timestamp.

Landing order is #929 first, then this test-only follow-on. Both PRs remain open; the description explains the shared commits and rebasing after #929 lands. Build, typecheck, lint, 74 focused unit tests, and all three source CLI tests pass. Full-suite baseline limitations are documented separately.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P1 blocking] src/source.ts:683 — Installation manifests are isolated, but deletion is not coordinated across manifests sharing the same physical destination. If teams A and B both use user scope and install the same source skill into ~/.claude/skills/foo, removing the source from A deletes foo even though B’s manifest still owns that path. Stale-skill cleanup has the same problem at src/source.ts:518. Check for another installation owning the destination path before deleting it.

Previous Finding

  • Resolved: repository clones are now keyed by source URL at src/source.ts:42, so removing and re-adding the same name with a different URL no longer reuses the old clone.

The PR description includes sufficient representative real-CLI verification. The recorded commit predates the head, but that is non-blocking under the review rules.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from bc6f01e to 919355e Compare October 1, 2026 08:54
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the shared-physical-destination finding in #929's combined implementation and rebased this dependent test commit on top. New manifests record their destination root, and the shared removal helper checks other active source manifests before deleting a physical path. Both explicit removal and stale cleanup now leave B's skill and manifest intact when A releases its ownership; B's later removal deletes the final owned path. The guard also covers different aliases and symlinked/overlapping destinations.

Four new real-CLI shared-HOME cases fail on the prior implementation and pass with the fix. The dependency additionally retains a scoped cleanup path after shared team configuration removes an alias. Landing order remains #929 first, then this regression-only follow-on. Exact verification is recorded in the updated descriptions.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/source.ts:728 — Existing sources/<name>/installed.json manifests are ignored without migration. Immediately after upgrading, teamai push treats previously installed source skills as local candidates and may commit third-party skills into the team repo; source remove also leaves those deployed files behind.
  • [P1 blocking] src/source.ts:695 — Shared-path protection preserves the current bytes, not the remaining owner’s version. If sources A and B both install foo and B writes last, removing B skips deletion because A owns the path, but leaves B’s content installed and then classifies it as A-owned. Restore the remaining owner’s copy or prevent different sources from sharing the destination.
  • [P2 non-blocking] src/source.ts:664 — Every manifest is treated as a live owner indefinitely. If a team checkout is moved or deleted without first removing its user-scope source, its unrecoverable hash-named manifest permanently protects the shared skill path, so later source remove operations report success but cannot remove it.

Previous Findings

  • Resolved: repository caches are now keyed by source URL.
  • Resolved: removing one active installation no longer deletes a path still recorded by another installation.

The PR description includes sufficient representative real-CLI verification.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from 919355e to fa45902 Compare October 1, 2026 09:55
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the sequential ownership findings together in #929 and rebased #931's regression-only follow-on on top.

Different repositories can no longer overwrite an already owned shared destination. Conflicts are checked before any copy; existing working copies survive new target conflicts, and repository replacements cannot relabel historical paths. Push checks actual scanned paths, quarantines ambiguous legacy names, and fails closed for malformed/unreadable ownership records. Source mutations use the existing atomic lock; previews no longer mutate repository caches.

Legacy records are deliberately not migrated into deletion authority: their destination is unknown, so doing so would recreate the original unrelated-file deletion risk. They remain preserved, with push quarantine and a documented manual-review path. Missing checkouts are likewise not treated as proof of abandonment. Full concurrent push/source publication isolation remains a documented P2 limitation rather than an unsafe inferred cleanup or a new broad locking protocol.

The descriptions include exact final-head verification, 196 focused unit tests, 94 loader regressions, nine real-CLI cases, negative controls, and the separately reproduced sandbox-only full-suite failures. Landing order remains #929 first, then #931.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

No findings.

  • Previous URL-cache reuse issue is resolved by URL-keyed repositories.
  • Shared-destination deletion and conflicting-content issues are resolved by ownership checks.
  • Legacy manifests are now quarantined from push and documented for manual cleanup.
  • The PR description includes sufficient representative real-CLI verification. The older tested commit is non-blocking under the review rules.
  • Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from fa45902 to aca8b20 Compare October 1, 2026 10:15
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the remaining ownership-release findings in 42cf8f3 (#929); #931 is rebased to aca8b20 and remains the 35-line crossover regression follow-on.

  • A valid config that omits publicSkills, publishes an empty list, or has no remaining published skill directories now releases the prior installation. A missing/unreadable source config still preserves it.
  • Every successful pull records its current paths and retires obsolete destinations even when the repository URL is unchanged. Foreign owners keep their files; conflict-retained copies keep their old records. Another producer can use a released destination without being blocked by a stale claim.
  • The mutex is outside the source-alias namespace, and a source with no eligible installed tool no longer gains false ownership.

Eleven negative-control failures reproduce these cases on the previous implementation. Updated validation: build/typecheck/lint pass; 206 focused tests and 94 read-only-loader tests pass; all 13 real-CLI cases pass on both heads with retries disabled. The full unit run has 6,708 passes, 22 failures, and one skip; all 22 failing test names exactly match the separately reproduced untouched-main sandbox baseline described in the PR body. An isolated loader timeout during concurrent validation passed on its dedicated rerun.

The two latest code findings are covered by unit and real-CLI regressions. Conservative legacy/orphan handling and the documented full push/source transaction-isolation limitation remain unchanged. Exact-head hosted CI is still being followed. Landing order remains #929 first, then #931.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P1 blocking] src/source.ts:587 — Same-repository ownership is accepted using only the URL hash, but caches are separated by source alias. If two teams install the same URL under different aliases, alpha can refresh to commit B while beta’s separate cache remains at commit A; beta’s next pull within TTL is allowed to overwrite the shared destination with stale commit A. Removing beta then preserves those stale bytes because alpha still owns the path. Share the cache by repository ID or verify cached revisions/content before allowing same-repository overwrites.

Review Notes

  • Previous URL-reuse, cross-manifest deletion, conflicting-producer, and legacy-manifest findings remain resolved.
  • The PR description includes sufficient representative real-CLI verification.
  • Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from aca8b20 to bd02c10 Compare October 1, 2026 10:33
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Both newly reproduced alias transitions are addressed in 674755b (#929), with the dependent crossover test rebased to bd02c10 (#931).

  • All aliases of the same configured URL now use one hash-keyed clone and pull timestamp under ~/.teamai/source-repos/, guarded by the existing source lifecycle mutex. A TTL hit or failed refresh under another alias cannot select an older alias-specific revision. Removing an alias still never deletes this shared cache. Older alias-scoped caches remain untouched and are not adopted.
  • Removal compares the scoped manifest's repository identity with the current subscription before editing shared teamai.yaml. An old or unidentified installation can clean its own files/record but preserves a re-added subscription, its comments, and the other destination's manifest/files.

The new real-CLI negative controls fail on the previous head: beta rolls revision B back to A, and stale beta removal deletes alpha's replacement URL from YAML. Both pass now. Coverage exercises distinct commits, TTL reuse, offline fallback, removal under both aliases, known/unknown stale identities, and dry-run preservation before any later pull can repair state.

Build/typecheck/lint pass; 207 focused tests and all 94 read-only-loader regressions pass. All 16 source real-CLI cases pass on both heads with retries disabled. The full unit run has 6,709 passes, the same 22 untouched-main sandbox failures, and one skip. The cache readers/writers, TTL, alias removal, replacement, and physical-path transitions were reviewed together. Updated docs retain the explicit legacy/orphan and full push/source transaction-isolation limits.

Exact-head CI and review are still pending. Landing order remains #929, then #931; #931's unique change remains the 35-line crossover regression.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

No findings.

  • Resolved: same-repository aliases now share the URL-keyed cache and revision at src/source.ts:64, preventing stale-cache overwrites.
  • Earlier URL reuse, shared-path deletion, conflicting-content, and legacy-manifest findings remain resolved.
  • The PR description includes sufficient representative real-CLI verification. Its recorded head differs from the reviewed head, but this is non-blocking under the review rules.
  • Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from bd02c10 to f2ed4fd Compare October 1, 2026 10:49
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

The deletion-authority finding is fixed in b1736a7 (#929), with #931 rebased to f2ed4fd.

Manifest reads now reject empty/root-equivalent, escaping, absolute, drive-relative, and NUL-containing paths, plus unsafe fallback skill names. Invalid records are rejected before source removal changes YAML or files. Cleanup also independently refuses lexical root equality and resolved physical roots/ancestors. Public source names pass the same relative-path safety check before deployment; legitimate nested names remain supported.

Twenty negative validator fixtures were accepted by the previous code and are rejected now. The built CLI also rejects eight malformed cleanup attempts while preserving configuration bytes, the invalid manifest, and the installed skill, and releasing its lock.

Build/typecheck/lint pass. Validation is now 231 focused tests, 94 read-only-loader tests, and 16 real-CLI cases on each head, with retries disabled. The full unit run has 6,733 passes, the same 22 reproduced untouched-main sandbox failures, and one skip. Independent review of the validator and deletion boundaries found no further concrete bypass. Exact-head hosted CI and the new review are still pending.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P1 blocking] src/source.ts:325 — source remove writes teamai.yaml before validating the ownership records required for cleanup. If the current manifest is valid but another installations/*.json file is malformed or unreadable, getSourcePathOwners() subsequently throws: the command fails while the subscription has already been removed, leaving its deployed files and manifest orphaned. Validate ownership before changing configuration, or make the removal transactional.

Review Notes

  • All findings from earlier review passes remain resolved.
  • The PR description includes sufficient representative real-CLI verification.
  • Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from f2ed4fd to afe9001 Compare October 1, 2026 11:14
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the name-priority and removal-order findings in 417e314 (#929), with #931 rebased to afe9001.

  • Public and recorded skill identities must already be canonical. Normalization-changing segments, repeated separators, backslashes, and trailing slashes are rejected before deployment. Legitimate canonical nested names still work, but may not overlap local-team or builtin skill roots in either direction. The same guard covers deployment, stale cleanup, and direct removal.
  • Source removal builds the full ownership-checked deletion plan before editing YAML. Malformed foreign records and physical-root targets now leave configuration, manifests, and installed files untouched. The existing source mutex protects the ownership plan; no new transaction/lock protocol was added.

Ten negative name fixtures and a real-CLI malformed-peer case reproduce the previous failures. Added coverage also preserves team/builtin script directories when a stale nested source is removed, and verifies ordinary canonical nested deployment/withdrawal still works.

Build/typecheck/lint pass; 244 focused tests and 94 read-only-loader tests pass. All 16 real-CLI cases pass on both heads with retries disabled. The full unit run has 6,746 passes, the same 22 untouched-main sandbox failures, and one skip. Updated descriptions document the current behavior and existing limits. Exact-head hosted CI/review are being followed; landing order remains #929 then #931.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Findings

  • [P2 non-blocking] src/source.ts:914 — Nested source identities are stored verbatim (for example namespace/foo), while scanAgentSkills() classifies the deployed directory by basename (foo). Consequently, supported nested source skills appear as [local-only] in teamai status --verbose and teamai skill show. Map the deployed name/path to its source rather than only the manifest identity.
  • [P2 non-blocking] src/agent-skills.ts:58 — One malformed or unreadable scoped manifest makes getSourceSkillOrigins() throw, and this catch silently discards provenance for every otherwise-valid source. Status and skill details then label all source skills as local-only. Handle failures per manifest or report that provenance could not be determined.

Review Notes

  • The previously reported removal transaction issue is resolved: ownership and deletion targets are preflighted before editing teamai.yaml.
  • The PR description includes sufficient representative real-CLI verification.
  • Tests were not run, per instruction.

Comment thread skill-data/core/SKILL.md Outdated

Git subscription caches are keyed by repository URL hash and shared across aliases, so the same URL shares its revision and TTL while different URLs remain isolated. Changing the URL uses the newly configured repository’s cache; a failed pull uses only that repository's cache. `source remove` retains repository caches for other installations.

Git source installations are keyed by team checkout and destination (HOME, project, or worktree). `source remove` releases the current installation and retains shared caches/other owners. It can still clean a scoped record after another destination removed the alias from shared team configuration. If that alias was re-added for a different repository, stale or unidentified records authorize only local cleanup and preserve the new subscription. Physical paths remain until their last source owner releases them.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Please do not modify this skill

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the direct edits to skill-data/core/SKILL.md from the shared dependency. The file is unchanged from current main in both #929 (da14bd0) and #931 (8362373); the usage guides and directory design retain the behavior documentation.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from afe9001 to 8362373 Compare October 1, 2026 15:39
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the nested ownership and provenance findings in da14bd0 (#929), with #931 rebased to 8362373 on the same implementation and current main (85ff72c).

  • Canonical nested names remain supported. Before any copy, pull rejects ambiguous parent/child boundary changes and exact-path collisions between different skill identities. The previous installation stays intact with manual-review/removal guidance. Ordinary nested updates, disjoint moves, and same-repository/same-skill exact-path sharing still work.
  • Retained files keep their source provenance when protected by team/builtin content or a foreign child installation. Validated fallback paths from older scoped records remain visible to physical ownership and push filtering. Removing a child owner cannot expose the retained parent's source bytes as local content.
  • Status and skill details use actual scoped physical paths for nested source labels, including duplicate aliases. Unrelated same-named copies and bundled modules are not adopted. Unreadable provenance emits an explicit uncertainty warning.
  • Removed all direct changes to skill-data/core/SKILL.md from both PR diffs, as requested. The usage guides and directory design retain the behavior and safety documentation.

Validation on these heads: build, typecheck, and lint pass; 302 focused tests and 94 read-only loader regressions pass; all 22 real-CLI cases pass on each head with retries disabled. The six new parent/child CLI scenarios fail on the prior implementation and pass with this guard. A built-CLI list/show smoke also verifies nested labels, duplicate aliases, and unrelated-copy isolation.

The full local unit run has 6,907 passes, one skip, and the same 22 MCP sandbox failures reproduced on untouched 85ff72c; there are no final-only failures. Updated PR descriptions include the detailed test record and remaining legacy/orphan/concurrency limits. Exact remote heads are verified; new-head hosted CI and review are being followed. Landing order remains #929, then the regression-only #931.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P2 non-blocking] src/source.ts:39 — This PR substantially changes source lifecycle, ownership, cleanup, and manual-recovery behavior, but the final diff leaves skill-data/ unchanged. This violates the repository rule requiring behavior changes to update affected agent skills—the human usage guides now explain retained ownership and manual cleanup, while agents loading the core skill receive none of that guidance. Add a concise source-lifecycle section to the relevant skill-data/core content or reference.

All previously reported implementation findings remain resolved. The PR description includes sufficient representative real-CLI verification. Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from 8362373 to 8dcd8aa Compare October 1, 2026 16:26
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Fixed physical-destination ownership in 9f105c2 (#929); #931 is rebased to 8dcd8aa with only its 35-line crossover regression unique to that PR.

  • Manifests pin actual post-copy physical destinations. Pull, withdrawal, and removal verify all old destinations before any installed-file, YAML, or manifest change. Repointed, removed, dangling, or unverifiable links stop with manual-review guidance.
  • Foreign ownership stays tied to the original pin. Cleanup rechecks it and deletes the canonical target. Copy preflight models leaf-symlink replacement and refuses lexical boundary changes that would abandon an old pin, including an old nested child.
  • Newly installed stable symlink paths and canonical nested names remain supported. Historical unpinned symlink paths cannot establish past ownership and require manual review; plain historical paths remain compatible.

All 37 new focused pin regressions pass, including both leaf-link transition negative controls. Three real-CLI negative controls reproduce the previous deletion/overwrite and now pass, with exact YAML/manifest preservation and successful recovery after restoring the original link. Final validation on both heads: all 25 real-CLI cases pass with retries disabled; build/typecheck/lint pass. There are 339 focused passes plus 94 loader passes. Full units: 6,944 passed, one skipped, and exactly the same 22 sandbox failures reproduced on untouched main 85ff72c.

The core-skill diff remains empty in accordance with the explicit human review instruction. The automated P2 request to add that text back conflicts with this instruction; the bilingual usage guides and directory design carry the safety guidance. Exact-head hosted CI/review are being followed. No PR has been merged or closed.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P2 non-blocking] src/source.ts:39 — This PR changes source caching, ownership, cleanup, recovery, and provenance behavior, but leaves skill-data/ unchanged. This violates the repository rule requiring behavior changes to update affected agent-facing skills. Add concise lifecycle and recovery guidance to the relevant skill-data/core content.

All previously reported implementation issues remain resolved. The PR description includes sufficient representative real-CLI verification; its older recorded head is non-blocking. Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from 8dcd8aa to ada8cea Compare October 1, 2026 16:51
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the path-scoped push finding in 3ae5798 (#929), with dependent #931 rebased to ada8cea.

Modern manifests with complete physical pins are now excluded only by owned physical paths. A Claude source foo no longer hides an independent Codex foo. Name-only quarantine is limited to legacy/unpinned or rootless/incomplete ownership and includes nested basenames; malformed pin metadata still fails closed. Scoped provenance labels are unchanged.

The negative real-CLI case reproduces the previous silent omission. The fixed CLI selects and publishes the independent Codex payload to the fixture's local bare repository, while preserving/excluding Claude's source-owned bytes. Legacy and scoped-unpinned cases remain quarantined. All 21 new focused cases and three CLI cases pass.

Final verification: build/typecheck/lint pass; 360 focused tests plus 94 loader regressions pass; all 28 source real-CLI cases pass on each head with retries disabled. The isolated full suite has 6,965 passes, one skip, and exactly the 22 failures reproduced on untouched main 85ff72c. One earlier concurrent loader timeout cleared in both its focused run and the isolated full rerun. Both existing PRs remain open, with #929 first and #931's unique diff still the 35-line crossover test. New-head hosted CI and review are being followed.

The core skill remains unchanged as requested by the human reviewer; the usage guides and directory design retain the documented safety and recovery limits.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P2 non-blocking] src/source.ts:39 — The diff changes source caching, ownership, cleanup, recovery, and provenance behavior but leaves skill-data/ unchanged, contrary to the repository rule requiring behavior changes to update affected agent-facing skills. Add concise lifecycle and recovery guidance to the relevant skill-data/core reference.

All previously reported implementation findings remain resolved. The PR description includes sufficient representative real-CLI verification. Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from ada8cea to e34c581 Compare October 1, 2026 17:33
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Restored safe Codex reconciliation in 4aeefc9 (#929), with #931 rebased to e34c581.

The first resolver pass remains side-effect free. After every ownership/transition and cleanup-candidate check passes, the existing resolver removes an unowned configured duplicate only when it matches both the shared copy and incoming source. Foreign/current owners, planned paths, physical aliases, repository cache, and resolved inputs are protected. Different local copies keep their conflict warning and remain push candidates; dry-run changes nothing.

The same boundary review reproduced source-root link data loss. In-repository root aliases now install concrete directories; outside/dangling/looping root aliases stop before deployment. Previously installed root links keep their manifests and referents for manual review, even when an older pin exists. Ordinary nested names and stable tool-destination symlinks still work. This correction adds no further manifest fields or nested file-link migration.

Thirty focused regressions and six new real-CLI cases pass. The full final validation includes 390 focused tests, 94 loader tests, and all 34 real-CLI source cases on each head with retries disabled. Build/typecheck/lint pass. Full units: 6,995 passed, one skipped, and exactly the same 22 MCP sandbox failures reproduced on untouched main 85ff72c.

Both branches are updated and their dependency remains unchanged: #929 contains the implementation, #931 adds only the 35-line crossover regression. The core-skill diff stays empty as requested by the human reviewer; bilingual usage/design documentation covers the behavior and limits. Following hosted CI and review for these exact heads.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Findings

  • [P1 blocking] src/source.ts:838 — Replacing a repository loses ownership of old skills when a valid scoped manifest lacks installedPaths. Cleanup is skipped, but saveSourceManifest() then overwrites the record with only the new deployment. For example, an unpinned record owning old-skill, followed by an alias change to a repository publishing only new-skill, leaves old-skill deployed without quarantine or provenance, allowing a later teamai push to publish third-party content. Preserve the old claim for manual review or safely adopt and remove its plain fallback paths.
  • [P2 non-blocking] src/source.ts:39 — The runtime changes source caching, ownership, cleanup, recovery, and provenance behavior, but skill-data/ remains unchanged. This still violates the repository rule requiring behavior changes to update affected agent-facing skills.

Review Notes

  • Previously reported URL-cache, shared-destination, path-pin, provenance, and removal-preflight issues remain resolved.
  • The PR description includes sufficient representative real-CLI verification; the older recorded head is non-blocking.
  • Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from e34c581 to 4706ed7 Compare October 1, 2026 18:11
@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P2 non-blocking] docs/usage-guide.md:2450 — The PR documents substantial source lifecycle, ownership, recovery, and push-safety changes, but leaves skill-data/ unchanged. This violates the trusted AGENTS.md requirement that behavior changes update affected agent-facing skills. Add concise lifecycle and recovery guidance to the relevant skill-data/core reference.

Review Notes

  • Resolved: repository replacement now preserves unrecorded prior claims at src/source.ts:660.
  • Previously reported runtime issues remain resolved.
  • The PR description includes sufficient representative real-CLI verification; the recorded head predates the reviewed head, which is non-blocking.
  • Tests were not run, per instruction.

@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Addressed the remaining P1 about old scoped claims without recorded paths in 2b2f74d (#929), inherited by 4706ed7 (#931). Repository replacement now keeps the entire prior installation and warns before fallback adoption or any deployment. Ambiguous scoped names also remain quarantined across checkouts sharing HOME; fully pinned modern records still filter by actual path only. No new deletion authority or guessed migration paths were added.

Validation: 26 focused new cases, 3 new built-CLI cases, and the complete 37-case source CLI suite pass on both heads with retries disabled. The full implementation run has 7,021 passes and the same 22 failures independently reproduced on untouched main in this sandbox; 416 focused plus 94 loader tests, build, typecheck, and lint pass. Hosted checks are following these exact heads.

The core skill remains unchanged as requested by the human reviewer; equivalent guidance is in the bilingual usage guides and directory design. #929 remains the implementation to land first, with #931 retaining only its 35-line crossover extension as the unique change.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from 4706ed7 to 8d1485d Compare October 1, 2026 19:33
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Resolved the changed-toolPaths P1 in efd9491 (#929), inherited by 8d1485d (#931). Lifecycle helpers no longer infer historical destinations from current configuration. Any missing or empty old path keeps the entire installation, files, and YAML intact for manual review, including same-repository update/withdrawal/removal and previews. Explicitly recorded plain paths remain supported.

The same missing-history boundary also protected against another checkout: ambiguous foreign scoped and rootless legacy claims now veto equal/parent/child logical names before copying or cleanup. This preserves the old claim without inventing a physical path or allowing same-repository aliases to bypass it. Unrelated names and complete recorded foreign paths retain their usual behavior.

All 16 affected real-CLI negative controls reproduced unsafe overwrite/deletion or lost tracking on the older builds and now pass. Final coverage: 481 focused tests, 94 loader tests, and 50 real-CLI source cases on each branch, retries disabled. Build/typecheck/lint pass. The complete unit run has 7,086 passes, one skip, and exactly the 22 failures independently reproduced on untouched main in this sandbox; hosted exact-head checks are following.

The human-requested core-skill removal remains honored. Bilingual usage/design documentation explains manual review and the conservative legacy limitation; no automatic destructive migration is claimed. #929 still lands first and #931 still adds only the 35-line crossover regression.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P2 non-blocking] docs/usage-guide.md:2450 — The PR changes source caching, ownership, cleanup, recovery, and push behavior, but leaves skill-data/ unchanged. This violates the trusted AGENTS.md requirement that behavior changes update affected agent-facing skills. Add concise lifecycle and recovery guidance to the relevant skill-data/core reference.

All previously reported implementation issues remain resolved. The PR description includes sufficient representative real-CLI verification. Tests were not run, per instruction.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from 8d1485d to 76f4cf5 Compare October 1, 2026 20:02
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Fixed accepted-alias enumeration in 18511bc (#929), inherited by 76f4cf5 (#931). All source metadata readers now use an unfiltered directory enumeration; normal resource scanning keeps its existing ignore rules. Previously accepted aliases remain supported. Missing metadata directories are empty, while other enumeration errors propagate rather than silently removing ownership.

All 49 alias-focused cases pass across the six filtered names plus an ordinary control. Both real-CLI negatives reproduce the reported risk on the prior build: a different producer overwrites node_modules-owned files, and a normal push exports .git-owned files to the local fixture remote. Both now pass; only the independent local draft is published.

Final validation: 530 focused tests, 94 loader tests, 52 real-CLI cases on each head, build, typecheck, and lint pass. Full suite: 7,135 passed, one skipped, exactly the same 22 sandbox failures reproduced on untouched main. Both branches retain the #929-first dependency and the unchanged core skill requested by the human reviewer. Following fresh exact-head hosted checks.

@github-actions

github-actions Bot commented Oct 1, 2026

Copy link
Copy Markdown

Finding

  • [P2 non-blocking] docs/usage-guide.md:2450 — The PR changes source caching, ownership, cleanup, recovery, provenance, and push behavior, but leaves skill-data/ unchanged. This violates the trusted AGENTS.md requirement that behavior changes update affected agent-facing skills. Add concise lifecycle and recovery guidance to the relevant skill-data/core content.

All previously reported implementation issues remain resolved. The PR description includes sufficient representative real-CLI verification; the recorded commit predating the reviewed head is non-blocking. Tests were not run, per instruction.

@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Final exact-head CI passed for #929 18511bc and #931 76f4cf5: all six Linux/macOS Node jobs, Build, fork-safe E2E, Code Erosion, and Tencent scan succeeded. The credentialed full-surface job is intentionally skipped for fork PRs.

The latest #929 review has no findings; #931 confirms all implementation issues are resolved and retains only the non-blocking skill-doc request already addressed by following the human instruction to leave the core skill unchanged. Both PRs are conflict-free and remain open for maintainer re-review. Land #929 first; #931's unique diff remains its 35-line crossover regression.

@NianJiuZst
NianJiuZst force-pushed the codex/fix-source-project-manifests branch from 76f4cf5 to 3e776f1 Compare October 2, 2026 03:21
@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Rebased after #929 merged. Head 3e776f1 is now one test-only commit on current main (aabf71c), with exactly the original 35-line crossover extension. There are no runtime, documentation, or core-skill changes, and existing nested-path support remains intact.

Build, typecheck, lint, and all 52 real-CLI source cases pass with retries disabled, including the nested-path cases. The full unit run has 7,148 passes, one skip, and 22 failures; I reran the four failing files on untouched current main and confirmed the identical 22 MCP sandbox failures, with no rebased-head-only failure.

The description now reflects the merged dependency and current test-only scope. Checking hosted CI for this exact rebased head.

@github-actions

github-actions Bot commented Oct 2, 2026

Copy link
Copy Markdown

No findings.

  • The reviewed range is tests-only: 35 lines added to src/__tests__/source-cache-isolation-e2e.test.ts:80.
  • The new assertions correctly cover URL re-add, offline shared-cache reuse, manifest isolation, retained ownership, and unchanged pull timestamps.
  • Earlier implementation findings remain resolved; the prior skill-data/ concern does not apply to this tests-only diff.
  • The PR description documents sufficient representative real-CLI verification. The recorded commit predates the reviewed head, which is non-blocking under the review rules.
  • Tests were not run, per instruction.

@NianJiuZst

Copy link
Copy Markdown
Contributor Author

Hosted checks passed for rebased head 3e776f1: all six Linux/macOS Node test lanes, Build, and fork-safe E2E, plus Code Erosion and Tencent scan. The credentialed-provider E2E job was intentionally skipped for this fork PR.

Automated review reports no findings and confirms the prior skill-documentation concern no longer applies to this tests-only diff. The 35-line regression is conflict-free on main after #929's merge. The PR remains open for human re-review.

@jeff-r2026
jeff-r2026 merged commit bae48e5 into Tencent:main Oct 2, 2026
13 checks passed
Walternater pushed a commit to Walternater/teamai-cli that referenced this pull request Nov 2, 2026
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.

2 participants