Repository navigation
feat: promotion candidate detector and pk candidates list|accept|reject - #36
Merged
Merged
Conversation
OpenSpec change openspec/changes/promotion-candidates and the two integration tests, committed before the implementation per the team's RED/GREEN rule. Without the implementation the worker writes no candidates and pk has no candidates subcommand, so both tests fail. They were not executed at this commit (implementation-first policy). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ct (GREEN) pk-learning-worker: after draining jobs, run-once fingerprints lessons (word-trigram shingles) into ~/.prometheus/learning-index/lessons.jsonl and proposes candidates under ~/.prometheus/promotion-candidates/pending when a lesson recurs (Jaccard >= 0.6) across >= 2 projects, is tagged global without a marker, or names a dependency/CLI with no repo-relative path. Writes are atomic and idempotent; decided candidates are never re-proposed. pk-cli: new 'pk candidates list|accept|reject --kind promotion|skill'. accept upserts into the shared KB, commits the shared prompt snapshot, queues a schemaVersion 2 add_memory op for @global (or @user:<hash>) in the learning-queue outbox, and moves the file to accepted/. Skill accept is refused until skill promotion lands. OpenSpec: openspec/changes/promotion-candidates. No dependency or Cargo.lock change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Change C1a of
team-aware-learning-memory-impl. Promotion beyond a project is now auto-proposed and human-confirmed (skill-system design §3).pk-learning-worker/src/promotion.rsruns after the job loop inrun-once.~/.prometheus/learning-index/lessons.jsonl, with project and source evidence.[GLOBAL]/[USER]marker, or names a dependency or CLI and has no repo-relative path.~/.prometheus/promotion-candidates/pending/<id>.json, with an evidence list. Proposal is idempotent, and a candidate already accepted or rejected is never re-proposed.pk candidates list|accept|reject --kind promotion|skill(frozen surface: additive):acceptupserts the lesson into the shared KB aspromoted-<id>and commits the shared prompt snapshot.add_memoryop in the learning-queue outbox, keyed@global/@global(or@user:<hash>/@userfor a user-scoped candidate).payloadHashis the SHA-256 of the arguments.accepted/.rejectmoves the file torejected/.--kind skill,listandrejectwork.acceptexits non-zero with "not yet supported".openspec/changes/promotion-candidates/. It covers the proposal with its consumers table, the design (including a known race and the noise trade-off), the spec, and the tasks.Cargo.lockis unchanged.Commits
ec23551RED: the OpenSpec change and both integration tests. They were not executed at that commit, because the repository's implementation-first policy defers test runs.d7905e4GREEN: the implementation, plus rustfmt applied to the test file.Test plan (local, serialized Cargo)
verify.shrunscargo test -p pk-learning-worker --test promotion(1 passed) andcargo test -p pk-cli --test candidates(2 passed):verify OK.cargo test --locked -p pk-cli --test context --test context_scoring --test tags_and_type: 3 + 3 + 1 passed.cargo test --locked -p pk-learning-worker --test attribution --test worker: 2 + 5 passed.cargo clippy --locked -p pk-learning-worker --bins --test promotion --test attribution --test worker -- -D warnings: clean.cargo clippy --locked -p pk-cli --all-targets -- -D warnings -A clippy::too_many_arguments: clean.cargo fmt --all -- --check,cargo clippy --workspace --all-targets --locked -- -D warnings,cargo test --workspace --locked. Two failures already exist onorigin/main, and the gate will hit them:pk-cli/src/main.rs::run_contexttripsclippy::too_many_arguments(8 of 7).pk-learning-worker's bin unit tests do not compile, because thelearning_jobhelper nearmain.rs:1711lacksproject_id,team_idandrole_idafter fix(worker): attribute learning to project/team/role and commit the prompt snapshot #32.docs/guide/13-tools-reference.md, andkbd-open.sh/reflector surfacing of pending candidates.Review status: builder-context only, not independent.
🤖 Generated with Claude Code