@svayam-opensource/prj 0.5.8 → 0.5.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svayam-opensource/prj",
3
- "version": "0.5.8",
3
+ "version": "0.5.9",
4
4
  "description": "Governed Agentic Development Framework CLI (prj). A bash CLI wrapped for npm; operates on a governance workspace resolved via $ADF_WORKSPACE or the nearest org-config.yaml. Runtime prerequisites (not npm deps): bash, git, gh, yq, python3 (use Git Bash on Windows).",
5
5
  "bin": {
6
6
  "prj": "bin/prj"
package/prj CHANGED
@@ -1465,6 +1465,18 @@ cmd_upgrade() {
1465
1465
  echo " Push: git push origin $DEFAULT_BRANCH"
1466
1466
  }
1467
1467
 
1468
+ # Validate a governance DATA workspace (schema/registry/lifecycle/cross-refs/
1469
+ # knowledge-org/secrets). This is the npm CLI surface that replaces a consumer
1470
+ # repo's vendored scripts/validate/ in CI (Option C un-vendor). Runs the data
1471
+ # subset (skips CLI/framework-dev checks) against $WORKSPACE_ROOT.
1472
+ # NB: privacy (org-config values must not leak into PUBLIC content) is a
1473
+ # publish-lane check — it lives in the template repo's CI, not here.
1474
+ cmd_validate() {
1475
+ header "Validate Workspace"
1476
+ divider
1477
+ python3 "$SCRIPTS/validate/run.py" --data "$WORKSPACE_ROOT"
1478
+ }
1479
+
1468
1480
  # ── Manage: project assignment commands ──────────────────────────────────────
1469
1481
  #
1470
1482
  # Open to anyone with write access to the workspace repo. GitHub enforces
@@ -2349,6 +2361,7 @@ case "$CMD" in
2349
2361
  deps) cmd_deps ;;
2350
2362
  manage) cmd_manage "${2:-}" ;;
2351
2363
  upgrade) cmd_upgrade "${2:-}" ;;
2364
+ validate) cmd_validate ;;
2352
2365
  help|--help|-h)
2353
2366
  echo ""
2354
2367
  echo -e "${BOLD}Usage:${NC} ./prj [command]"
@@ -359,9 +359,26 @@ CHECKS = [
359
359
  ("version-sync", check_version_sync),
360
360
  ]
361
361
 
362
+ # Data-workspace subset: a pure governance DATA repo (a consumer that installs
363
+ # the CLI from npm) has no scripts/ , agent/ harness, or package.json, so the
364
+ # CLI/framework-dev checks (exec-bits, protocol render, version-sync) don't apply.
365
+ # `prj validate` (and a consumer's CI) runs this subset via --data.
366
+ DATA_CHECKS = [
367
+ ("schema", check_schema),
368
+ ("registry", check_registry),
369
+ ("lifecycle", check_lifecycle),
370
+ ("cross-refs", check_cross_refs),
371
+ ("knowledge-org", check_knowledge),
372
+ ("secrets", check_secrets),
373
+ ]
374
+
362
375
 
363
376
  def main() -> int:
364
- repo_root = Path(sys.argv[1] if len(sys.argv) > 1 else ".").resolve()
377
+ argv = sys.argv[1:]
378
+ data_only = "--data" in argv
379
+ argv = [a for a in argv if a != "--data"]
380
+ repo_root = Path(argv[0] if argv else ".").resolve()
381
+ checks = DATA_CHECKS if data_only else CHECKS
365
382
 
366
383
  if not (repo_root / "registry.yaml").exists():
367
384
  print(
@@ -371,7 +388,7 @@ def main() -> int:
371
388
  return 1
372
389
 
373
390
  total_errors = 0
374
- for name, check in CHECKS:
391
+ for name, check in checks:
375
392
  errors = check(repo_root)
376
393
  if errors:
377
394
  print(f"[FAIL] {name} ({len(errors)} error{'s' if len(errors) != 1 else ''}):")