Skip to content

feat(contribute): select an active learnings namespace (#916) - #979

Open
zszz3 wants to merge 3 commits into
Tencent:mainfrom
zszz3:codex/contribute-namespace
Open

zszz3 wants to merge 3 commits into
Tencent:mainfrom
zszz3:codex/contribute-namespace

Conversation

@zszz3

@zszz3 zszz3 commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Allow contribute --namespace <ns> to choose an active learnings namespace when a directory reads several namespaces. Invalid targets are rejected before queue/index/worktree writes; omitting the option preserves the existing single-namespace/shared-root default.

projects list now shows the default destination and accepted namespaces. Update CLI help, its generated command reference, both usage guides and the affected design. All SKILL.md bodies remain unchanged.

Type of Change

  • New feature (non-breaking change that adds functionality)

Test Plan

Local macOS, Node 26.7.0:

  • Build, TypeScript check, lint, git diff --check, and the generated command-reference check passed.
  • Full unit suite with npm 11.6.0: 8,009 passed, 26 skipped (run on the original implementation; subsequent changes only reverted skill text and synchronized the generated reference).
  • Targeted real-CLI E2E tests: 14 passed, including all 13 namespace cases.
  • Full npm run test:e2e after reverting skill changes: 545 passed, 50 skipped, 5 failed. The five failures are all in stats-recall-dry-run.test.ts; a separate, unmodified a8957a8 checkout reproduces the same five failures. These existing failures are addressed by fix(dry-run): restore stats and recall previews with inferred credits #977, which is still open. Skips include unavailable Git hook capabilities and remote-provider credentials.

Before the change, the built CLI on a8957a8 wrote contributions from a multi-namespace project to the shared root and rejected --namespace payments as an unknown option.

After the change, a manual built-CLI run against a local bare Git remote verified: contribute to learnings/payments/, verify the published bytes, recall from the contributor, then pull and recall the same content as a second isolated member. Dry-run left the complete fixture unchanged; an unavailable namespace exited 1 without publishing.

Additional real-CLI checks passed for namespace names differing from project IDs, Unicode and spaces, two projects sharing one namespace, and an offline queued contribution retaining its original namespace after the active project changed. Additional remote-provider/agent coverage is deferred to CI.

Related Issues

Fixes #916

Notes for Reviewers

The selected namespace is stored in the existing queued relative path. Queue format, publication locks and retry behavior are unchanged. The whole branch diff and shared-state readers/writers were reviewed.

@zszz3 zszz3 closed this Oct 4, 2026
@zszz3 zszz3 reopened this Oct 4, 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.

[feat] contribute --namespace, to file a learning under one of the namespaces a directory reads

1 participant