test(ledger): the transition/prefix references clear the flag end to end; plugin 0.1.45 (#2970)
CI & Build / Python lint (push) Successful in 4s
CI & Build / Plugin hooks (push) Successful in 8s
CI & Build / integration (push) Successful in 25s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 1m3s
CI & Build / Build & push image (push) Successful in 14s
CI & Build / Python lint (push) Successful in 4s
CI & Build / Plugin hooks (push) Successful in 8s
CI & Build / integration (push) Successful in 25s
CI & Build / TypeScript typecheck (push) Successful in 32s
CI & Build / Python tests (push) Successful in 1m3s
CI & Build / Build & push image (push) Successful in 14s
Integration cover for the seam the unit tests only meet at either end: a
template that names no class at all (`<transition-group name="toast">`) and
one that builds its class (`` `status-${s}` ``) run through the real
extractor, through resolve_consumers, into `flag="unused-css"` — and the
rules they reach stop being reported, while a rule nothing can reach stays
listed. The prefix credits BOTH status rows, which is the documented
reading: the template does not say which one it built.
The manifest bump is what the last commit owed — it edited the
shape-accounting skill, and the installer compares versions to decide
whether to refresh the cache that actually executes (#2209), so plugin
edits that ship without a bump reach the repo and stop there. CI caught it
on 4323; 0.1.44 -> 0.1.45.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "scribe",
|
||||
"description": "Scribe system-of-record for Claude Code: MCP tools over your notes/tasks/projects/rules, a session-start push channel that surfaces your always-on rules + active-project context, process-skills (writing-plans, systematic-debugging, verification, brainstorming, reusing-code), and your saved Scribe Processes auto-surfaced as skills (/scribe:sync). Replaces superpowers + file-memory with one app-backed plugin.",
|
||||
"version": "0.1.44",
|
||||
"version": "0.1.45",
|
||||
"author": { "name": "Bryan Van Deusen" },
|
||||
"mcpServers": {
|
||||
"scribe": {
|
||||
|
||||
@@ -683,6 +683,58 @@ async def test_derive_new_names_the_copy_that_joined_a_family_since_the_stamp(se
|
||||
assert derive_new_summary(rows, since=None)["count"] == 0
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
async def test_transition_and_prefix_references_clear_the_unused_css_flag(seeded):
|
||||
"""#2970 end to end: the two class forms a template never spells out —
|
||||
a transition `name=` and a concatenated name — travel from the real
|
||||
extractor through resolution into the flag, so rules they reach stop
|
||||
being reported as unused. Only a rule nothing can reach stays listed."""
|
||||
from scribe.services.coverage import class_references
|
||||
from scribe.services.shape_ledger import sync_repo_consumers, used_by_map, live_rows
|
||||
|
||||
pid, owner = seeded["pid"], seeded["owner"]
|
||||
defs = _defs(
|
||||
("assets/anim.css", "css", "toast-enter-active",
|
||||
".toast-enter-active {", ".toast-enter-active { opacity: 0 }"),
|
||||
("assets/anim.css", "css", "toast-leave-to",
|
||||
".toast-leave-to {", ".toast-leave-to { opacity: 0 }"),
|
||||
("assets/state.css", "css", "status-done",
|
||||
".status-done {", ".status-done { color: green }"),
|
||||
("assets/state.css", "css", "status-todo",
|
||||
".status-todo {", ".status-todo { color: grey }"),
|
||||
("assets/state.css", "css", "really-dead",
|
||||
".really-dead {", ".really-dead { color: red }"),
|
||||
)
|
||||
await sync_repo_shapes(pid, REPO, defs, seen_marker="t1")
|
||||
|
||||
refs = {
|
||||
# Vue applies the toast-* classes itself; the markup names none of them.
|
||||
"v/Toast.vue": class_references(
|
||||
"v/Toast.vue", '<transition-group name="toast"><li /></transition-group>'
|
||||
),
|
||||
# The board builds its status class; which one is unknowable.
|
||||
"v/Board.vue": class_references("v/Board.vue", '<b :class="`status-${s}`" />'),
|
||||
}
|
||||
assert "toast-enter-active" in refs["v/Toast.vue"]
|
||||
assert refs["v/Board.vue"] == {"status-*": 1}
|
||||
|
||||
await sync_repo_consumers(pid, REPO, refs)
|
||||
live = [r for r in await live_rows(pid) if r.kind == "css"]
|
||||
used = await used_by_map(live)
|
||||
by = {(r.path, r.symbol): used[r.id]["count"] for r in live}
|
||||
assert by[("assets/anim.css", "toast-enter-active")] == 1
|
||||
assert by[("assets/anim.css", "toast-leave-to")] == 1
|
||||
# the prefix credits BOTH candidates — the template does not say which
|
||||
assert by[("assets/state.css", "status-done")] == 1
|
||||
assert by[("assets/state.css", "status-todo")] == 1
|
||||
assert by[("assets/state.css", "really-dead")] == 0
|
||||
|
||||
unused, n = await list_project_shapes(owner, pid, flag="unused-css")
|
||||
assert n == 1 and [(r.path, r.symbol) for r in unused] == [
|
||||
("assets/state.css", "really-dead")
|
||||
]
|
||||
|
||||
|
||||
@pytest.mark.integration
|
||||
async def test_consumer_map_syncs_edges_from_template_references(seeded):
|
||||
"""Milestone 302: the consumer edges follow the archive — own-file
|
||||
|
||||
Reference in New Issue
Block a user