Repository navigation
Conversation
`dokimi catalog novelty ROOT --out-dir DIR --max-usd USD` runs `skill novelty analyze` on every SKILL.md under ROOT, one row per skill written to --jsonl as each finishes. - --max-usd is the whole-run budget (required; a paid sweep without one is refused). --max-usd-per-skill caps one skill inside it: a skill that hits its cap is a `partial` row and leaves no novelty file, and the sweep goes on. - --jobs runs skills in threads that share the budget through NestedSpendCap, which charges the run's SpendCap first. - --resume keeps the ok rows whose directory digest, settings and dokimi version still match, runs the rest, and keeps the rows of skills this run does not select (a narrower --limit). - Refuses an existing --jsonl without --resume and --judge2. - Summary: already-known share (k0.lenient) headline, new share = 1 - known, bootstrap 95% CIs overall and per stratum (--strata CSV). --summary-only reads the JSONL with no model call. Tests use a fake priced transport; no paid call is made. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
The CLI surface now matches the base branch: no user-facing CLI change. |
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #846 +/- ##
==========================================
- Coverage 96.13% 96.13% -0.01%
==========================================
Files 498 498
Lines 66004 66053 +49
Branches 11461 11467 +6
==========================================
+ Hits 63456 63502 +46
+ Misses 1576 1575 -1
- Partials 972 976 +4
🚀 New features to boost your workflow:
|
…s row - A skill with no paired probe read k0 0.0 and so a new share of 1.0 and status ok. A zero pair count is now the no_pairs error row. - A failed save of novelty.json escaped the per-skill try, ended the sweep and dropped the rows of the other in-flight skills. It is that skill's error row now; the paid analysis is already spent. - The resume fingerprint omits --max-file-words, --max-resource-words, --allow-self-judge and the placebo text, so a resume kept rows measured under other inputs. They are in it now. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
729ece6 to
e04df87
Compare
…s documented Ctrl-C or SIGTERM during `catalog novelty` used to let the queued skills run, each with its paid calls, and their rows were dropped. Now the first signal cancels the skills not started (no new call), the skills in flight finish and keep their rows, and the run exits 130 (SIGINT) or 143 (SIGTERM). The rows written stay in the JSONL, so `--resume` continues. A second signal raises KeyboardInterrupt at once. Two directories whose SKILL.md files are identical stay one skill (the shallowest path is kept, no row for the copy); this is now stated in the command docs and --help, and pinned by a test. Signal handling is polled, not an async raise: a KeyboardInterrupt raised between submit and bookkeeping lost a finished row in a test, so the sweep checks a stop request every 0.2 s instead. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…ts them finish The first Ctrl-C or SIGTERM of a catalog novelty sweep cancels the queued skills and lets the running ones finish, as the docs say. The SIGTERM branch also called process.kill_children, which killed those running calls (error rows) and latched the process as closing. Now only a second signal kills the calls in flight, then stops at once. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…ignal in the drain A row whose write raised after the append was written again by the drain, since the future was discarded only after the write. The drain now discards before the write and writes the rows already done before it waits for the skills in flight, so an interrupt during the wait keeps them. The changelog sentence is fixed. Red tests first. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
…s they finish A skill queued behind one in flight could start when a worker freed up before the main thread saw the stop. The queued call now checks the stop first. The drain writes each row as its skill finishes, so an interrupt during the wait keeps the ones done. The docs say a second signal kills only subprocess calls (an API call is waited for), and that identical copies must also name the same skill. Red tests first. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
… signal's API row is documented The three drain tests depended on thread timing: a queued skill could be cancelled before it ran, and the test asserted it was kept. They now wait until the skills are running, and the write-once test asserts only that the finished row is written once. The docs and help say a second signal does not kill an API call in flight, and that its row is then not written. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
The catalog novelty summary lists the measured skills by how much of each one the model did not already know, per 1k tokens of the skill: the top ten in text, all of them in the --summary-out JSON as `ranking`. The already-known share stays the headline. No model call and no CLI change. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
A JSONL that two sweeps wrote lists a skill twice in the ranking. It now has one entry per skill key, taken from the latest ok row; the overall figures still sum every ok row. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
e04df87 to
fa60189
Compare
Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
read_rows accepted an ok row with only key and status, and summarize then raised a bare KeyError. It now raises InputError naming the line. Adds a test for a tree_digest OSError leaving the item without a digest. Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
main moved usd_amount out of novelty_run into cli_types as positive_usd, so importing it in catalog_novelty failed and broke the CLI. Imports the new name and refreshes the CLI interface snapshot. Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
|
🟢 Ready for re-review · 3 commits on Next: a re-review of the new head. Nothing needed from @napetrov. Changes
Verified on the new head: ✅ 1/1 tests fail before the fix, pass after · ✅ full suite with main merged in: 22896 passed · ✅ second reader: nothing raised · What each test shows
|
Fixes in `catalog novelty`: - import `positive_usd` from `dokimi.cli_types`: main no longer has `usd_amount` in `novelty_run`, so the parser failed to build. - a second signal sets a hard stop that refuses the next call of the skills in flight, and a second signal inside the poll wait writes no row and waits for no skill. - two bundles with one SKILL.md and different resources are two skills. - the resume digest includes the entry point's content, so a symlinked SKILL.md that changed is measured again. - a skill measured again drops its old novelty.json and novelty.md. - the output directory name is bounded for long nested keys. - --summary-out may not be the --jsonl file, is written atomically and its directory is made before any paid work. - a JSONL row of the wrong shape is a line-numbered input error. - the CLI interface snapshot follows the changed help text. - tests pin the resume fingerprint; signal tests skip on Windows. Signed-off-by: vchamarthi <venkata.sai.gireesh.chamarthi@intel.com>
vchamarthi
left a comment
There was a problem hiding this comment.
🔴 Changes needed: 1 must-fix, 2 nits · reviewed 5dbfee0
Next: @napetrov: fix the 1 must-fix finding and settle 1 open question; then push for a re-review. 2 nits optional.
Blocking
- Open question for @napetrov: A later
errororpartialrow for a skill with an earlierokrow:rankingkeeps theokrow (dokimi/dokimi/novelty/sweep.py:186, pinned bytest_ranking_keeps_an_earlier_ok_row_past_a_later_error). State the latest-ok-row rule in the PR description, or changerankingto take the latest row of any status and update the test and both docs.
Verified on 5dbfee0: ✅ changed tests: 179 passed, fail on main · ✅ full suite with main merged in: 22899 passed · ✅ merges onto main ·
15 checks behind it, each with its evidence
| Area | What holds | How |
|---|---|---|
| Ranking values | The six changed test files pass on the head (179 passed), and test_ranking_orders_by_new_share_per_1k_tokens pins the order c, a, b at 1.0, 0.25 and 0.2 per 1k tokens |
tests on the head |
| Ranking membership | Skills with no token count, partial rows and error rows are left out of the ranking: test_ranking_leaves_out_rows_that_are_not_measured_or_have_no_size passes on the head |
tests on the head |
| Summary order | The already-known headline comes first and the ranking follows the stratum table: test_summary_lines_lead_with_the_already_known_share and test_summary_lines_list_the_ranking_after_the_stratum_table pass on the head |
tests on the head |
| Top ten and every skill | The text lists ten of twelve measured skills, and the summary's ranking keeps all twelve |
ran it |
| One entry per skill | An empty list ranks nothing, a skill in two sweeps is ranked once from its later ok row, and equal rates are ordered by key |
ran it, edge input (collections) |
| Zero and fractional numbers | A row with tokens 0 is left out without a division, and a share of 0.0 is ranked at 0.0 |
ran it, edge input (numbers) |
| Missing values | A row with no share or no size is left out of the ranking, and a summary with no measured row ends with the line saying no skill was measured | ran it, edge input (none) |
| Row structure | A line that is {}, [], null or has no key is refused with its line number as not a sweep row |
ran it, edge input (structured) |
| Row text | Lines ending in CRLF are read, a U+2028 inside a key is kept, and a line that is not UTF-8 is refused with its line number | ran it, edge input (text) |
| Command refusals | With no --max-usd, catalog novelty exits nonzero with the paid-calls message, and --summary-only on an absent JSONL says it has no rows |
ran it, edge input (cli) |
| Missing root | A ROOT that does not exist is refused with the message that it is not a directory | ran it, edge input (paths) |
| Stop before start | With a stop requested before the skills start, _run_sweep makes no call and writes no row |
ran it, edge input (concurrency) |
| Latest row pinned | Taking the first ok row for a skill instead of the latest fails the one-entry test, so the latest-row rule is pinned |
broke the code, tests caught it |
| Import fix | The import of positive_usd from dokimi.cli_types resolves on the head, and the full run with main merged in passes: 22899 passed, 0 failed |
full suite, main merged in |
| Merge | The PR merges onto current main with no conflict | merge onto main |
The sweep returned 0 when the budget, an unpriced call or a provider error left skills partial, error or not run. It now exits 1 after the rows and the summary are written, as the novelty commands do on a budget stop (docs/quickstart.md, Exit codes). Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…r skill A revoked key or a wrong model id made every later skill pay its extraction calls and then meet the same error. The first skill that stops on no_price or permanent_error now ends the sweep, as the cap does: the remaining skills are counted as not run. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…ites With --model equal to --judge-model, a --resume rewrote the JSONL without its ok rows and deleted each novelty.json before analyze refused the judge, then exited 0. The check now runs with the other input refusals (exit 2), as skill novelty analyze does. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
--judge given twice or --judge-aggregate ran to ok rows graded by the first judge alone, with no panel in the novelty file or the resume fingerprint. The sweep now refuses them as it refuses --judge2. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…error read_rows passed an ok row that lacked the field, and the summary then crashed with KeyError (exit 5). The row is now refused with its line number, as a row with a non-numeric new_lenient already is. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
The sweep's own files changed that skill's digest, so every --resume measured and paid for it again. Both paths are now refused before any call when they sit inside a selected skill. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
tree_digest hashes a symlink root by its link text, so editing a bundled file behind a symlinked ROOT kept the stale ok row on resume. The digest now walks the resolved directory; other digests are unchanged. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Feed ranking the same latest bundle measurements as the summary, so moving a bundle retains only its current rank. Preserve the latest-key behavior for a skill whose contents change. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 5 selected item(s). CI at Test notes (1)
Review details
|
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟡 Changes needed · reviewed 9d3beba
To fix: the ranking's number does not mean what its docstring says and puts small skills first by size alone (line comments); the test and input gaps there are smaller.
✅ make ci-local --offline: 27,084 passed · schema_compat fails from the base, not from this PR · ✅ a 5000-token skill 60% new ranks below a 500-token one 20% new: 0.12 vs 0.40 · ranking() leaves the 116 sweep tests green
Reading the latest ok row, the top-ten text and the full JSON list fit the rest of the summary well.
… dedup A sweep row whose tokens is not a whole number (1e-320 ranked first with an infinite rate and wrote Infinity into --summary-out) is now refused. The latest-ok-row ranking test now uses two digests for one key so it reaches the per-key dedup, and the duplicated summary-lines test that an earlier commit added under the same name is removed. Signed-off-by: vchamarthi <123653452+vchamarthi@users.noreply.github.com>
|
@napetrov, could you answer the question below? I'll ask for a re-review after that. Changes:
Needs @napetrov:
Threads and comments:
Left open:
What I checked on the new commit: 1 of 1 tests fail before the fix and pass after it; the full test suite passes with main merged in (30,941 tests), apart from 1 failure main has too. What each test shows
|
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
Re: review by vlad-perevezentsev
|
|
|
The deduplication test and fractional-token validation are covered by |
vchamarthi
left a comment
There was a problem hiding this comment.
@napetrov, could you fix the 2 small things I've marked fix before merge (in the line comments) and fix what vlad-perevezentsev's thread on dokimi/dokimi/novelty/sweep.py:234 still points out? I'll approve once that's done.
I'll approve once that's done.
What I checked on b620a02:
- When I broke the changed code on purpose, the tests missed 3 of 12 breakages.
- The 124 changed tests pass, and fail on main as expected.
- The full test suite passes with main merged in (31,413 tests), apart from failures main has too.
- It merges cleanly onto main.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g8677sfR Thread: PRR_kwDOVBg7g88AAAABaSR3ig Thread: IC_kwDOVBg7g88AAAABq3lO3A Test-narrowed: The new-share ordering and tie-break tests supersede the per-1k ranking checks. The summary still checks the heading, first ranked key, and per-key deduplication under the new order. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g868Jzsj Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g868Jzs2 Thread: PRR_kwDOVBg7g88AAAABaZbEIQ Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
Re: review by vlad-perevezentsev
|
|
|
vchamarthi
left a comment
There was a problem hiding this comment.
@napetrov, could you fix the new problem I found and the small thing I've marked fix before merge (in the line comments)? Then push and I'll take another look.
What I checked on 355b837:
- When I broke the changed code on purpose, the tests missed 2 of 12 breakages.
- The 126 changed tests pass, and fail on main as expected.
- The full test suite passes with main merged in (31,962 tests), apart from failures main has too.
- It merges cleanly onto main.
Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g868Oxa3 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Thread: PRRT_kwDOVBg7g868Oxa8 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
Summary
Adds a ranking to the catalog novelty sweep from #840. The summary sorts skills by descending
new_lenient, the share of each skill that is new to the model. Equal shares sort by smaller token count, then skill key.Text shows the top ten after the stratum table.
--summary-outrecords the full ranking withkey,name,new_lenientandtokensfor every eligible skill. A later partial or failed run keeps the last successful measurement. A latest successful measurement needs a new share and a positive token count to appear in the ranking. Renamed bundles use their latest successful measurement. Differently named identical bundles observed together keep their separate measurements.Evidence
Merge Danger
Door: two-way. Adds a
rankingfield to the saved sweep summary and a ranking to the text summary.Blast Radius:
catalog noveltysummaries.