@techgoblin/gobstack 0.6.0-alpha.4 → 0.6.0-beta.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 (110) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/README.md +249 -116
  3. package/VERSION +1 -1
  4. package/bans/README.md +5 -5
  5. package/bans/grep-ban.sh +1 -1
  6. package/bin/goblin-bans +103 -27
  7. package/bin/goblin-init +345 -259
  8. package/bin/goblin-install +269 -213
  9. package/bin/goblin-lib.sh +63 -66
  10. package/bin/goblin-map +130 -579
  11. package/bin/goblin-mcp.js +9 -14
  12. package/bin/goblin-verify +249 -993
  13. package/bin/goblin.js +4 -9
  14. package/docs/GUIDE.md +724 -179
  15. package/docs/LIMITS.md +273 -301
  16. package/docs/RECORD-NOTES.md +1 -2
  17. package/manifest/bans.tsv +9 -9
  18. package/manifest/categories.tsv +18 -0
  19. package/manifest/enforcement.tsv +11 -67
  20. package/manifest/glossary.tsv +6 -12
  21. package/manifest/library.tsv +33 -0
  22. package/package.json +1 -4
  23. package/skills/goblin-bootstrap/SKILL.md +20 -32
  24. package/skills/goblin-feature-map/SKILL.md +1 -1
  25. package/skills/goblin-verify-author/SKILL.md +2 -2
  26. package/skills/practice/SKILL.md +4 -4
  27. package/templates/AGENTS.md.tmpl +6 -6
  28. package/templates/HANDOFF.md.tmpl +1 -1
  29. package/templates/SPEC.md.tmpl +2 -2
  30. package/templates/agents-block.tmpl +1 -10
  31. package/adapters/_template/adapter.tsv +0 -16
  32. package/adapters/_template/detect.sh +0 -10
  33. package/adapters/_template/emit.sh +0 -5
  34. package/adapters/_template/verify.sh +0 -4
  35. package/adapters/claude/adapter.tsv +0 -8
  36. package/adapters/claude/detect.sh +0 -8
  37. package/adapters/claude/verify.sh +0 -47
  38. package/adapters/codex/adapter.tsv +0 -12
  39. package/adapters/codex/detect.sh +0 -9
  40. package/adapters/codex/verify.sh +0 -45
  41. package/adapters/copilot/adapter.tsv +0 -10
  42. package/adapters/copilot/detect.sh +0 -8
  43. package/adapters/copilot/verify.sh +0 -45
  44. package/adapters/cursor/adapter.tsv +0 -11
  45. package/adapters/cursor/detect.sh +0 -10
  46. package/adapters/cursor/verify.sh +0 -45
  47. package/adapters/gemini/adapter.tsv +0 -15
  48. package/adapters/gemini/detect.sh +0 -11
  49. package/adapters/gemini/verify.sh +0 -49
  50. package/adapters/hermes/adapter.tsv +0 -9
  51. package/adapters/hermes/detect.sh +0 -8
  52. package/adapters/hermes/verify.sh +0 -27
  53. package/adapters/opencode/adapter.tsv +0 -14
  54. package/adapters/opencode/detect.sh +0 -9
  55. package/adapters/opencode/verify.sh +0 -45
  56. package/automations/README.md +0 -53
  57. package/automations/bugreporter-intake.sh +0 -145
  58. package/automations/drift-audit.sh +0 -139
  59. package/automations/report.schema.tsv +0 -10
  60. package/bin/goblin +0 -144
  61. package/bin/goblin-audit +0 -143
  62. package/bin/goblin-doctor +0 -233
  63. package/bin/goblin-emit +0 -495
  64. package/bin/goblin-extras +0 -365
  65. package/bin/goblin-model +0 -105
  66. package/bin/goblin-upgrade +0 -580
  67. package/docs/ADOPTION.md +0 -173
  68. package/docs/CI.md +0 -190
  69. package/docs/CONTRACTS.md +0 -218
  70. package/docs/DESIGN.md +0 -92
  71. package/docs/ENFORCEMENT.md +0 -228
  72. package/docs/FLOWS.md +0 -164
  73. package/docs/GLOSSARY.md +0 -40
  74. package/docs/GUARDRAILS.md +0 -126
  75. package/docs/INTEGRATION.md +0 -92
  76. package/docs/LOOP.md +0 -165
  77. package/docs/RE-PLAYBOOK.md +0 -183
  78. package/docs/RISKS.md +0 -70
  79. package/docs/ROLES.md +0 -105
  80. package/extras-catalogue/catalogue.tsv +0 -42
  81. package/extras-catalogue/payload/README.md +0 -14
  82. package/extras-catalogue/payload/taste-skill/taste/REFERENCE.md +0 -3
  83. package/extras-catalogue/payload/taste-skill/taste/SKILL.md +0 -9
  84. package/manifest/classes.tsv +0 -51
  85. package/manifest/playbooks.tsv +0 -16
  86. package/presets/electron-overlay.yaml +0 -38
  87. package/presets/fleet.yaml +0 -43
  88. package/presets/game.yaml +0 -38
  89. package/presets/research.yaml +0 -41
  90. package/presets/service.yaml +0 -40
  91. package/presets/software.yaml +0 -48
  92. package/roles.yaml +0 -54
  93. package/skills/goblin-bugfix/SKILL.md +0 -26
  94. package/skills/goblin-bugreporter/SKILL.md +0 -52
  95. package/skills/goblin-drift-audit/SKILL.md +0 -43
  96. package/skills/goblin-eval/SKILL.md +0 -68
  97. package/skills/goblin-feature/SKILL.md +0 -26
  98. package/skills/goblin-investigation/SKILL.md +0 -26
  99. package/skills/goblin-judge/SKILL.md +0 -74
  100. package/skills/goblin-loop/SKILL.md +0 -88
  101. package/skills/goblin-mode/SKILL.md +0 -70
  102. package/skills/goblin-overnight/SKILL.md +0 -42
  103. package/skills/goblin-pr-gate/SKILL.md +0 -42
  104. package/skills/goblin-re-mobile/SKILL.md +0 -51
  105. package/skills/goblin-refactor/SKILL.md +0 -23
  106. package/skills/goblin-sweep/SKILL.md +0 -23
  107. package/skills/goblin-tdd-repro/SKILL.md +0 -27
  108. package/templates/audit-waiver.tsv.tmpl +0 -10
  109. package/templates/install-hooks.allowlist.tmpl +0 -9
  110. package/templates/report.yaml.tmpl +0 -16
package/bin/goblin-lib.sh CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env bash
2
2
  # goblin-lib.sh — shared helpers for goblin-stack.
3
3
  #
4
- # Sourced by bin/goblin-install, bin/goblin-verify and bin/goblin-model.
4
+ # Sourced by bin/goblin-install and bin/goblin-verify.
5
5
  # Dependencies: bash 4+, git, awk, sed, grep, sha256sum (or shasum).
6
6
  # No npm, no jq, no yq, no network.
7
7
  #
@@ -16,7 +16,7 @@
16
16
  # - name: typecheck four-space-indented second member of a list entry
17
17
  # cmd: npx tsc --noEmit
18
18
 
19
- GOBLIN_LIB_VERSION="0.6.0-alpha.4"
19
+ GOBLIN_LIB_VERSION="0.6.0-beta.1"
20
20
 
21
21
  # ---------------------------------------------------------------- output -----
22
22
  # g_trunc <width> <text> — fold a long detail to one line at <width> columns, keeping the
@@ -62,7 +62,7 @@ g_pass() {
62
62
  }
63
63
  # FAIL keeps its row line whole in every mode, and the matrix's remedy column rides under it.
64
64
  # The remedy is the TSV's own cell (IN-01/IN-02/GT-03/CM-01 carry prose there; the pre-remedy
65
- # rows carry `—`, which prints nothing) — the JG-02 judge-lane `remedy:` line, brought to every
65
+ # rows carry `—`, which prints nothing) — a `remedy:` line, brought to every
66
66
  # row that names one, so the fix a failure needs is printed where the failure is read. A missing
67
67
  # column (a manifest written before the column existed) is no remedy, not an error: empty is the
68
68
  # same as `—`.
@@ -270,16 +270,15 @@ g_part_disabled() {
270
270
  g_yaml_disabled "$1" | grep -qx "$2"
271
271
  }
272
272
 
273
- # ------------------------------------------------------------- class data ----
274
273
  # ------------------------------------------------------------- agents.md -----
275
274
  # v2 config engine: the project config lives in AGENTS.md FRONTMATTER, delimited by
276
- # fixed markers. There is no goblin.yaml. One file is the single source of truth:
275
+ # fixed markers. There is no separate config file. One file is the single source of truth:
277
276
  #
278
277
  # <!-- gob:begin (gobstack config) -->
279
- # class: software
280
- # branch: main
278
+ # harness_dir: checks
279
+ # source_root: src
281
280
  # ratchet.ceiling: 160 # one nested level = a dotted key
282
- # bans: [BN-01, BN-02] # a list is a one-line JSON-ish array
281
+ # bans_disabled: [BN-02] # a list is a one-line JSON-ish array (the ban OFF-switch)
283
282
  # gate_commit_cmd: git rev-parse --verify --quiet HEAD
284
283
  # <!-- gob:end -->
285
284
  #
@@ -433,41 +432,6 @@ g_agents_write() {
433
432
  rm -f "$tmp" "$tmp.out"; return 1
434
433
  }
435
434
 
436
- # g_class_canon <spelling> -> the canonical class NAME
437
- # software | service | game | research | fleet
438
- # The taxonomy is five domain-named classes. The letters A-E and the older taught domain names
439
- # (app, agent, desktop) stay as READ-TIME aliases so every existing installed.json / goblin.yaml
440
- # - which record a letter or an old name - keeps verifying with no rewrite. `desktop` / `F` / `f`
441
- # resolve to `software`: F was merged into A (their classes.tsv need columns are identical), and
442
- # what made a desktop shell different is the `electron:` opt-in + ban list, config keys the repo
443
- # already carries. Unknown spelling -> empty output; the caller refuses with the enum.
444
- g_class_canon() {
445
- case "$1" in
446
- software|A|a|app) printf 'software' ;;
447
- service|B|b) printf 'service' ;;
448
- game|C|c) printf 'game' ;;
449
- research|D|d) printf 'research' ;;
450
- fleet|E|e|agent) printf 'fleet' ;;
451
- desktop|F|f) printf 'software' ;;
452
- *) return 1 ;;
453
- esac
454
- }
455
-
456
- # g_class_is_electron_alias <spelling> -> 0 when the spelling is the merged desktop/F spelling.
457
- # `--class desktop` (or F/f) must mean the OLD desktop install, not a silently weaker software
458
- # one: the installer auto-sets electron: true so the alias behaves as F did.
459
- g_class_is_electron_alias() {
460
- case "$1" in desktop|F|f) return 0 ;; *) return 1 ;; esac
461
- }
462
-
463
- # g_class_need <classes.tsv> <class> <part> -> R | O | -
464
- g_class_need() {
465
- awk -F'\t' -v c="$2" -v p="$3" '
466
- NR > 1 && $1 == c && $2 == p { print $3; found = 1; exit }
467
- END { if (!found) print "-" }
468
- ' "$1"
469
- }
470
-
471
435
  # ---------------------------------------------------------------- json -------
472
436
  # installed.json is emitted by goblin-install in a fixed, line-oriented shape so it can
473
437
  # be read without a JSON library. g_json_object <installed.json> <object-name> -> "key<TAB>value".
@@ -545,8 +509,8 @@ g_self_test() {
545
509
  local tmp rc=0
546
510
  tmp=$(mktemp -d 2>/dev/null || mktemp -d -t goblin) || { g_err "mktemp failed"; return 2; }
547
511
  cat > "$tmp/g.yaml" <<'YAML'
548
- class: B
549
- branch: master
512
+ flavour: B
513
+ revision: master
550
514
  archive: false
551
515
  disabled: [spec, tokens]
552
516
  gates:
@@ -556,13 +520,13 @@ ratchet:
556
520
  name: hex
557
521
  ceiling: 160
558
522
  runtime_data:
559
- - .goblin/state.json
523
+ - .gob/state.json
560
524
  YAML
561
525
 
562
526
  local got
563
- got=$(g_yaml_scalar "$tmp/g.yaml" class)
527
+ got=$(g_yaml_scalar "$tmp/g.yaml" flavour)
564
528
  [ "$got" = "B" ] || { g_err "scalar: expected B, got '$got'"; rc=1; }
565
- got=$(g_yaml_scalar "$tmp/g.yaml" branch)
529
+ got=$(g_yaml_scalar "$tmp/g.yaml" revision)
566
530
  [ "$got" = "master" ] || { g_err "scalar: expected master, got '$got'"; rc=1; }
567
531
  got=$(g_yaml_scalar "$tmp/g.yaml" nosuchkey)
568
532
  [ -z "$got" ] || { g_err "scalar: absent key should be empty, got '$got'"; rc=1; }
@@ -586,7 +550,7 @@ YAML
586
550
  got=$(g_yaml_gate_names "$tmp/g2.yaml" | tr '\n' ',')
587
551
  [ "$got" = "typecheck,reindented," ] || { g_err "gate-names: got '$got'"; rc=1; }
588
552
  got=$(g_yaml_list "$tmp/g.yaml" runtime_data | tr '\n' ',')
589
- [ "$got" = ".goblin/state.json," ] || { g_err "list: got '$got'"; rc=1; }
553
+ [ "$got" = ".gob/state.json," ] || { g_err "list: got '$got'"; rc=1; }
590
554
  got=$(g_yaml_disabled "$tmp/g.yaml" | tr '\n' ',')
591
555
  [ "$got" = "spec,tokens," ] || { g_err "disabled: got '$got'"; rc=1; }
592
556
 
@@ -597,10 +561,9 @@ YAML
597
561
  House rules the agent reads. The block below is machine-read.
598
562
 
599
563
  <!-- gob:begin (gobstack config — edit in place; the parser reads only this block) -->
600
- class: software
601
- branch: main
564
+ flavour: software
565
+ revision: main
602
566
  archive: false
603
- owner_email: team@example.com
604
567
  disabled: [spec, tokens]
605
568
  ratchet.name: hex
606
569
  ratchet.ceiling: 160
@@ -608,11 +571,11 @@ gate_typecheck_cmd: npx tsc --noEmit
608
571
  gate_commit_cmd: git rev-parse --verify --quiet HEAD
609
572
  <!-- gob:end -->
610
573
 
611
- Body prose continues here. A line like `class: decoy` outside the block must stay
574
+ Body prose continues here. A line like `flavour: decoy` outside the block must stay
612
575
  invisible to the parser.
613
576
  EOF
614
- printf 'class: decoy\n' >> "$tmp/AGENTS.md"
615
- got=$(g_agents_read "$tmp/AGENTS.md" class)
577
+ printf 'flavour: decoy\n' >> "$tmp/AGENTS.md"
578
+ got=$(g_agents_read "$tmp/AGENTS.md" flavour)
616
579
  [ "$got" = "software" ] || { g_err "agents scalar: expected software, got '$got'"; rc=1; }
617
580
  got=$(g_agents_read "$tmp/AGENTS.md" nosuchkey)
618
581
  [ -z "$got" ] || { g_err "agents scalar: absent key should be empty, got '$got'"; rc=1; }
@@ -629,35 +592,35 @@ commit:git rev-parse --verify --quiet HEAD" ] \
629
592
  got=$(g_agents_list "$tmp/AGENTS.md" disabled | tr '\n' ',')
630
593
  [ "$got" = "spec,tokens," ] || { g_err "agents list: got '$got'"; rc=1; }
631
594
  got=$(g_agents_keys "$tmp/AGENTS.md" | head -n 1)
632
- [ "$got" = "class" ] || { g_err "agents keys: got '$got'"; rc=1; }
595
+ [ "$got" = "flavour" ] || { g_err "agents keys: got '$got'"; rc=1; }
633
596
  # g_agents_write: stdin IS the whole new block (key<TAB>value lines); it rewrites
634
597
  # ONLY the block and preserves the body. Idempotent on a second identical write.
635
598
  {
636
- printf '%s\tsoftware\n' class
637
- printf '%s\tmain\n' branch
599
+ printf '%s\tsoftware\n' flavour
600
+ printf '%s\tmain\n' revision
638
601
  printf '%s\t42\n' max_dirty
639
602
  } | g_agents_write "$tmp/AGENTS.md" >/dev/null
640
603
  grep -q '^max_dirty: 42$' "$tmp/AGENTS.md" || { g_err "agents write: the new key is absent"; rc=1; }
641
604
  grep -qF 'Body prose continues here' "$tmp/AGENTS.md" \
642
605
  || { g_err "agents write: the body was not preserved"; rc=1; }
643
- grep -qF 'class: decoy' "$tmp/AGENTS.md" \
606
+ grep -qF 'flavour: decoy' "$tmp/AGENTS.md" \
644
607
  || { g_err "agents write: the body below the block was not preserved"; rc=1; }
645
- W1=$(g_agents_read "$tmp/AGENTS.md" class)
608
+ W1=$(g_agents_read "$tmp/AGENTS.md" flavour)
646
609
  [ "$W1" = "software" ] || { g_err "agents write: the block was destroyed ($W1)"; rc=1; }
647
610
  {
648
- printf '%s\tsoftware\n' class
649
- printf '%s\tmain\n' branch
611
+ printf '%s\tsoftware\n' flavour
612
+ printf '%s\tmain\n' revision
650
613
  printf '%s\t42\n' max_dirty
651
614
  } | g_agents_write "$tmp/AGENTS.md" > "$tmp/w2"
652
615
  grep -q unchanged "$tmp/w2" || { g_err "agents write: the second identical write is not a no-op"; rc=1; }
653
616
  # A fresh file: the block is created, and a body-less write stays parseable.
654
- printf '%s\ttrue\n' "electron" | g_agents_write "$tmp/fresh.md" >/dev/null
655
- [ "$(g_agents_read "$tmp/fresh.md" electron)" = "true" ] \
617
+ printf '%s\ttrue\n' "toggle" | g_agents_write "$tmp/fresh.md" >/dev/null
618
+ [ "$(g_agents_read "$tmp/fresh.md" toggle)" = "true" ] \
656
619
  || { g_err "agents write: a fresh file was not created parseable"; rc=1; }
657
620
  # A body-only file: the block is inserted before the first line.
658
621
  printf 'the body\n' > "$tmp/bodyonly.md"
659
- printf '%s\tmain\n' "branch" | g_agents_write "$tmp/bodyonly.md" >/dev/null
660
- [ "$(g_agents_read "$tmp/bodyonly.md" branch)" = "main" ] \
622
+ printf '%s\tmain\n' "revision" | g_agents_write "$tmp/bodyonly.md" >/dev/null
623
+ [ "$(g_agents_read "$tmp/bodyonly.md" revision)" = "main" ] \
661
624
  && grep -qx 'the body' "$tmp/bodyonly.md" \
662
625
  || { g_err "agents write: insertion into a body-only file failed"; rc=1; }
663
626
 
@@ -670,6 +633,40 @@ commit:git rev-parse --verify --quiet HEAD" ] \
670
633
  return "$rc"
671
634
  }
672
635
 
636
+ # g_next_block <target> <skills yes|no> [<declared-gate label>]
637
+ # THE one ordered next-steps list a completed install prints. `gob init --write` runs the engine
638
+ # (goblin-install), which calls this; init then calls it again for its own tail — so a user sees
639
+ # ONE list, never the two the front-door engine and the installer each used to print. Every line
640
+ # is true of the artefact the user now has:
641
+ # * the install is uncommitted (the record is written last and git is the user's to run);
642
+ # * verify re-runs the gate the config declares (GT-02);
643
+ # * when a gate LABEL is given the gate is the one the user declared and `gob init --write`
644
+ # MEASURED before writing it, so no edit is owed — the advice is only "edit the default gate"
645
+ # on a bare `goblin-install`, whose shipped gate is a generic default;
646
+ # * the seven-skill CORE tier ships under .gob/skills/ on EVERY install, so the agent-skill
647
+ # switch is about the .hermes/ project tier, not about whether any skill is present.
648
+ g_next_block() {
649
+ local target="$1" skills="$2" gate="${3:-}" gline
650
+ if [ -n "$gate" ]; then
651
+ gline="the gate is the one you declared and gob init measured ($gate); edit AGENTS.md's gate_ keys when it changes"
652
+ else
653
+ gline="edit AGENTS.md: replace the default gate with your real commands"
654
+ fi
655
+ printf 'next:\n'
656
+ printf ' 1. cd %s && git add -A && git commit # the install is uncommitted by design\n' "$target"
657
+ printf ' 2. .gob/bin/goblin-verify # re-runs the gate the config declares; green on a fresh repo\n'
658
+ printf ' 3. %s\n' "$gline"
659
+ if [ "$skills" = "yes" ]; then
660
+ printf ' 4. hermes skills trust %s # one-time, so the .hermes/ project tier loads\n' "$target"
661
+ elif [ "$skills" = "no" ]; then
662
+ printf ' 4. the core goblin tier ships under .gob/skills/ by default; the .hermes/ project tier is opt-in: re-run with --skills yes\n'
663
+ elif [ "$skills" = "all" ]; then
664
+ printf ' 4. all skills vendored under .gob/skills/; the .hermes/ project tier is opt-in: re-run with --skills yes\n'
665
+ else
666
+ printf ' 4. vendored under .gob/skills/: %s; the .hermes/ project tier is opt-in: re-run with --skills yes\n' "$skills"
667
+ fi
668
+ }
669
+
673
670
  # Allow `bash bin/goblin-lib.sh --self-test` and `source bin/goblin-lib.sh`.
674
671
  if [ "${BASH_SOURCE[0]}" = "${0}" ]; then
675
672
  case "${1:-}" in