@andresmassello/uscha 1.70.0 → 1.71.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -40,7 +40,7 @@ Requires **Python 3.8+** on the machine (the engine is Python stdlib — no pip
40
40
  runtime dependencies). The npm package is a thin router; the canonical installer is
41
41
  `uscha-kit/install-uscha.py`.
42
42
 
43
- **Kit v1.70.0** <!-- uscha:version --> · [uscha.dev](https://uscha.dev) ·
43
+ **Kit v1.71.0** <!-- uscha:version --> · [uscha.dev](https://uscha.dev) ·
44
44
  [changelog](https://github.com/andresmassello/uscha/blob/main/uscha-kit/CHANGELOG.md)
45
45
  (the per-release changelogs live in the repo, not in the npm tarball)
46
46
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@andresmassello/uscha",
3
- "version": "1.70.0",
3
+ "version": "1.71.0",
4
4
  "description": "Spec-driven development for LLM coding agents: 9 skills + a stdlib evidence engine. Facts block, guesses advise; the human approves.",
5
5
  "author": {
6
6
  "name": "Andres Massello",
@@ -4533,6 +4533,10 @@ def cmd_fidelity(args):
4533
4533
  sys.exit(2)
4534
4534
  obs = (delta.get("observations") or []) if delta else []
4535
4535
  verdicts = _curation_verdicts(ledger, args.repo)
4536
+ # fidelity respects the SAME bound that produced the delta (user decision, FR-001): a
4537
+ # bounded discovery is measured over its own subtree, so unexplained_code and the other
4538
+ # mechanical dimensions never mix the delta's scope with the whole repo's.
4539
+ bound = delta.get("path") if delta else None
4536
4540
  dims = {}
4537
4541
  # traceability: canonical items reachable in code via the uscha-spec id machinery
4538
4542
  canon_items = []
@@ -4543,7 +4547,17 @@ def cmd_fidelity(args):
4543
4547
  canon_items = json.load(fh).get("items") or []
4544
4548
  except (OSError, ValueError):
4545
4549
  canon_items = []
4546
- tracked = _tracked_files(repo_path) or []
4550
+ tracked = [f for f in (_tracked_files(repo_path) or []) if _under_bound(f, bound)]
4551
+ _scope = " (bounded to %s)" % bound if bound else ""
4552
+ if bound:
4553
+ # scope the DENOMINATOR too, not just the file scan: promote MERGES into CANONICAL
4554
+ # repo-wide, so an earlier unbounded promote would otherwise count out-of-bound
4555
+ # items as "no longer derives" -- the exact scope-mixing this release kills, half-
4556
+ # done if only the numerator moves (fresh-review LOW). An item is under the bound
4557
+ # when its primary provenance file is.
4558
+ canon_items = [it for it in canon_items
4559
+ if any(_under_bound(f.split(":")[0].split("#")[0], bound)
4560
+ for f in (it.get("provenance") or {}).get("files") or [])]
4547
4561
  marked, marker_files = set(), set()
4548
4562
  for f, mid in _scan_spec_markers(repo_path, tracked):
4549
4563
  marked.add(mid)
@@ -4552,8 +4566,8 @@ def cmd_fidelity(args):
4552
4566
  traced = sum(1 for it in canon_items if (it.get("derived_from") or "") in marked)
4553
4567
  dims["traceability"] = _fid_dim(round(traced / len(canon_items), 4),
4554
4568
  "uscha-spec marker scan over %d git-tracked "
4555
- "files vs %d canonical item(s)"
4556
- % (len(tracked), len(canon_items)))
4569
+ "files%s vs %d canonical item(s)"
4570
+ % (len(tracked), _scope, len(canon_items)))
4557
4571
  else:
4558
4572
  dims["traceability"] = _fid_dim(None, "UNMEASURED: no canonical items promoted yet")
4559
4573
  # behavior: the latest ingested golden-diff gate verdict
@@ -4579,9 +4593,9 @@ def cmd_fidelity(args):
4579
4593
  cur_ids = {o["id"] for o in cur_static}
4580
4594
  okc = sum(1 for it in static_canon if it.get("derived_from") in cur_ids)
4581
4595
  dims["contracts"] = _fid_dim(round(okc / len(static_canon), 4),
4582
- "re-ran static extractors; %d/%d canonical static "
4596
+ "re-ran static extractors%s; %d/%d canonical static "
4583
4597
  "item(s) still derive from the code"
4584
- % (okc, len(static_canon)))
4598
+ % (_scope, okc, len(static_canon)))
4585
4599
  else:
4586
4600
  dims["contracts"] = _fid_dim(None, "UNMEASURED: no static-class canonical items")
4587
4601
  # curation_closure: curated OBS / total OBS in the active delta
@@ -4616,14 +4630,15 @@ def cmd_fidelity(args):
4616
4630
  unex = [f for f in prod if f not in lineage]
4617
4631
  dims["unexplained_code"] = _fid_dim(
4618
4632
  round(len(unex) / len(prod), 4),
4619
- "%d/%d tracked prod source file(s) with no path to a canonical item or "
4620
- "preserved OBS (v0 granularity: FILE)" % (len(unex), len(prod)),
4633
+ "%d/%d tracked prod source file(s)%s with no path to a canonical item or "
4634
+ "preserved OBS (v0 granularity: FILE)" % (len(unex), len(prod), _scope),
4621
4635
  files=unex[:10] + (["(+%d)" % (len(unex) - 10)] if len(unex) > 10 else []))
4622
4636
  else:
4623
4637
  dims["unexplained_code"] = _fid_dim(None, "UNMEASURED: no tracked prod source files")
4624
4638
  dims["semantic"] = _fid_dim(None, "not wired: an LLM-judged comparison enters as "
4625
4639
  "advisory only and can NEVER gate (INV-ADVISORY-01)")
4626
4640
  out = {"repo": args.repo,
4641
+ **({"path": bound} if bound else {}),
4627
4642
  "dimensions": {k: dict(dims[k], **{"class": FIDELITY_DIMENSIONS[k]})
4628
4643
  for k in ("traceability", "behavior", "contracts",
4629
4644
  "curation_closure", "unexplained_code", "semantic")}}
@@ -4632,8 +4647,8 @@ def cmd_fidelity(args):
4632
4647
  if args.json:
4633
4648
  print(json.dumps(out, indent=2, ensure_ascii=False))
4634
4649
  else:
4635
- print("FIDELITY %s (vector -- no blend; each number stands on its own evidence):"
4636
- % args.repo)
4650
+ print("FIDELITY %s%s (vector -- no blend; each number stands on its own evidence):"
4651
+ % (args.repo, " [bounded to %s]" % bound if bound else ""))
4637
4652
  for k, d in out["dimensions"].items():
4638
4653
  val = "UNMEASURED" if d["value"] is None else "%.2f" % d["value"]
4639
4654
  print(" %-17s %-10s [%s] %s" % (k, val, d["class"], d["provenance"]))
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/claude-code-plugin-manifest.json",
3
3
  "name": "uscha",
4
- "version": "1.70.0",
4
+ "version": "1.71.0",
5
5
  "displayName": "Uscha",
6
6
  "description": "Spec-driven development for LLM coding agents: 9 skills (discovery, adr-refine, reverse-discovery, characterize, devloop, sysdoc, rubric, mirador, status) + a stdlib measurement engine (qa_ledger.py, 40 subcommands + universal installer + npm/npx router). Facts block, guesses advise; the human approves.",
7
7
  "author": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uscha",
3
- "version": "1.70.0",
3
+ "version": "1.71.0",
4
4
  "description": "Uscha spec-driven development methodology for coding agents. Includes npm/npx router.",
5
5
  "author": {
6
6
  "name": "Andres Massello",
@@ -1,6 +1,6 @@
1
1
  # uscha-kit
2
2
 
3
- **Kit version:** v1.70.0 <!-- uscha:version --> · **[uscha.dev](https://uscha.dev)**
3
+ **Kit version:** v1.71.0 <!-- uscha:version --> · **[uscha.dev](https://uscha.dev)**
4
4
 
5
5
  Spec-driven orchestrator + multi-repo QA for Claude Code, with a deterministic ledger.
6
6
  **Nine skills** (`uscha-discovery`, `uscha-adr-refine`, `uscha-devloop`, `uscha-sysdoc`, `uscha-reverse-discovery`,
package/uscha-kit/VERSION CHANGED
@@ -1 +1 @@
1
- uscha-kit 1.70.0
1
+ uscha-kit 1.71.0
@@ -1 +1 @@
1
- {"AC-FV-01": true, "AC-FV-02": true, "AC-FV-04": true, "AC-FV-05": true, "AC-FV-03": true, "review-h2": true, "review-m4": true}
1
+ {"AC-FV-01": true, "AC-FV-02": true, "AC-FV-04": true, "AC-FV-05": true, "AC-FV-03": true, "review-h2": true, "AC-FV-06": true, "review-m4": true}
@@ -4533,6 +4533,10 @@ def cmd_fidelity(args):
4533
4533
  sys.exit(2)
4534
4534
  obs = (delta.get("observations") or []) if delta else []
4535
4535
  verdicts = _curation_verdicts(ledger, args.repo)
4536
+ # fidelity respects the SAME bound that produced the delta (user decision, FR-001): a
4537
+ # bounded discovery is measured over its own subtree, so unexplained_code and the other
4538
+ # mechanical dimensions never mix the delta's scope with the whole repo's.
4539
+ bound = delta.get("path") if delta else None
4536
4540
  dims = {}
4537
4541
  # traceability: canonical items reachable in code via the uscha-spec id machinery
4538
4542
  canon_items = []
@@ -4543,7 +4547,17 @@ def cmd_fidelity(args):
4543
4547
  canon_items = json.load(fh).get("items") or []
4544
4548
  except (OSError, ValueError):
4545
4549
  canon_items = []
4546
- tracked = _tracked_files(repo_path) or []
4550
+ tracked = [f for f in (_tracked_files(repo_path) or []) if _under_bound(f, bound)]
4551
+ _scope = " (bounded to %s)" % bound if bound else ""
4552
+ if bound:
4553
+ # scope the DENOMINATOR too, not just the file scan: promote MERGES into CANONICAL
4554
+ # repo-wide, so an earlier unbounded promote would otherwise count out-of-bound
4555
+ # items as "no longer derives" -- the exact scope-mixing this release kills, half-
4556
+ # done if only the numerator moves (fresh-review LOW). An item is under the bound
4557
+ # when its primary provenance file is.
4558
+ canon_items = [it for it in canon_items
4559
+ if any(_under_bound(f.split(":")[0].split("#")[0], bound)
4560
+ for f in (it.get("provenance") or {}).get("files") or [])]
4547
4561
  marked, marker_files = set(), set()
4548
4562
  for f, mid in _scan_spec_markers(repo_path, tracked):
4549
4563
  marked.add(mid)
@@ -4552,8 +4566,8 @@ def cmd_fidelity(args):
4552
4566
  traced = sum(1 for it in canon_items if (it.get("derived_from") or "") in marked)
4553
4567
  dims["traceability"] = _fid_dim(round(traced / len(canon_items), 4),
4554
4568
  "uscha-spec marker scan over %d git-tracked "
4555
- "files vs %d canonical item(s)"
4556
- % (len(tracked), len(canon_items)))
4569
+ "files%s vs %d canonical item(s)"
4570
+ % (len(tracked), _scope, len(canon_items)))
4557
4571
  else:
4558
4572
  dims["traceability"] = _fid_dim(None, "UNMEASURED: no canonical items promoted yet")
4559
4573
  # behavior: the latest ingested golden-diff gate verdict
@@ -4579,9 +4593,9 @@ def cmd_fidelity(args):
4579
4593
  cur_ids = {o["id"] for o in cur_static}
4580
4594
  okc = sum(1 for it in static_canon if it.get("derived_from") in cur_ids)
4581
4595
  dims["contracts"] = _fid_dim(round(okc / len(static_canon), 4),
4582
- "re-ran static extractors; %d/%d canonical static "
4596
+ "re-ran static extractors%s; %d/%d canonical static "
4583
4597
  "item(s) still derive from the code"
4584
- % (okc, len(static_canon)))
4598
+ % (_scope, okc, len(static_canon)))
4585
4599
  else:
4586
4600
  dims["contracts"] = _fid_dim(None, "UNMEASURED: no static-class canonical items")
4587
4601
  # curation_closure: curated OBS / total OBS in the active delta
@@ -4616,14 +4630,15 @@ def cmd_fidelity(args):
4616
4630
  unex = [f for f in prod if f not in lineage]
4617
4631
  dims["unexplained_code"] = _fid_dim(
4618
4632
  round(len(unex) / len(prod), 4),
4619
- "%d/%d tracked prod source file(s) with no path to a canonical item or "
4620
- "preserved OBS (v0 granularity: FILE)" % (len(unex), len(prod)),
4633
+ "%d/%d tracked prod source file(s)%s with no path to a canonical item or "
4634
+ "preserved OBS (v0 granularity: FILE)" % (len(unex), len(prod), _scope),
4621
4635
  files=unex[:10] + (["(+%d)" % (len(unex) - 10)] if len(unex) > 10 else []))
4622
4636
  else:
4623
4637
  dims["unexplained_code"] = _fid_dim(None, "UNMEASURED: no tracked prod source files")
4624
4638
  dims["semantic"] = _fid_dim(None, "not wired: an LLM-judged comparison enters as "
4625
4639
  "advisory only and can NEVER gate (INV-ADVISORY-01)")
4626
4640
  out = {"repo": args.repo,
4641
+ **({"path": bound} if bound else {}),
4627
4642
  "dimensions": {k: dict(dims[k], **{"class": FIDELITY_DIMENSIONS[k]})
4628
4643
  for k in ("traceability", "behavior", "contracts",
4629
4644
  "curation_closure", "unexplained_code", "semantic")}}
@@ -4632,8 +4647,8 @@ def cmd_fidelity(args):
4632
4647
  if args.json:
4633
4648
  print(json.dumps(out, indent=2, ensure_ascii=False))
4634
4649
  else:
4635
- print("FIDELITY %s (vector -- no blend; each number stands on its own evidence):"
4636
- % args.repo)
4650
+ print("FIDELITY %s%s (vector -- no blend; each number stands on its own evidence):"
4651
+ % (args.repo, " [bounded to %s]" % bound if bound else ""))
4637
4652
  for k, d in out["dimensions"].items():
4638
4653
  val = "UNMEASURED" if d["value"] is None else "%.2f" % d["value"]
4639
4654
  print(" %-17s %-10s [%s] %s" % (k, val, d["class"], d["provenance"]))
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.70.0",
2
+ "version": "1.71.0",
3
3
  "project": null,
4
4
  "defaults": {
5
5
  "coverage_threshold": 60,