@chamba/core 0.4.0 → 0.5.1

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.
Files changed (2) hide show
  1. package/dist/index.js +12 -0
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -632,6 +632,8 @@ var SENSITIVE_PATH_RE = /(^|\/)(auth|payments|billing|migrations|secrets?|creden
632
632
  var WORKER_RE = /\b(implementer|tester|reviewer|worker)\b/i;
633
633
  var TESTS_RE = /\b(tests?|vitest|jest|spec|unit test|integration test)\b/i;
634
634
  var PLACEHOLDER_RE = /\b(todo|tbd|fixme|placeholder)\b/i;
635
+ var DELETION_RE = /\b(delete[ds]?|deleting|remove[ds]?|removing|removal|drop(?:ping|s|ped)?|eliminat\w*|deprecat\w*|elimina\w*|borra\w*|quita\w*)\b/i;
636
+ var ORPHAN_CHECK_RE = /\b(orphan\w*|dead[-\s]?code|unused\s+(?:export|import|symbol|function|code|reference)|referential|callers?|knip|ts-prune|depcheck|type-?check|typecheck|tsc|build\s+(?:passes|green|clean))\b/i;
635
637
  var DEFAULT_MODULES = /* @__PURE__ */ new Set([
636
638
  "packages",
637
639
  "examples",
@@ -716,6 +718,16 @@ function validatePlan(input) {
716
718
  suggestions.push('Add a concrete entry under "## Risks" describing the risk and mitigation.');
717
719
  }
718
720
  }
721
+ if (DELETION_RE.test(plan) && !ORPHAN_CHECK_RE.test(plan)) {
722
+ issues.push({
723
+ code: "deletion-without-orphan-check",
724
+ severity: "warning",
725
+ message: "The plan removes code but never mentions verifying referential closure: orphaned callers or now-unused exports left behind. Token grep alone misses these."
726
+ });
727
+ suggestions.push(
728
+ "After removing code, verify nothing was orphaned: run the build/typecheck and a dead-code check (e.g. knip / ts-prune), not just a grep."
729
+ );
730
+ }
719
731
  return { issues, suggestions, riskFlags };
720
732
  }
721
733
  function sections(plan) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chamba/core",
3
- "version": "0.4.0",
3
+ "version": "0.5.1",
4
4
  "description": "Core logic for chamba: workspace scanner, plan + heuristic reviewer, git worktrees, Obsidian, memory — no Node APIs, no LLM",
5
5
  "license": "MIT",
6
6
  "type": "module",