oc-harness-setup 0.1.1 → 0.3.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.
Files changed (114) hide show
  1. package/.docs/unwired-routing.md +14 -9
  2. package/.gitignore +14 -1
  3. package/AGENTS.md +70 -106
  4. package/README.md +31 -27
  5. package/agents/build.md +10 -12
  6. package/agents/explore.md +14 -8
  7. package/agents/general.md +7 -9
  8. package/agents/orchestrator.md +38 -0
  9. package/agents/plan.md +10 -13
  10. package/agents/reviewer.md +9 -14
  11. package/agents/vault.md +44 -35
  12. package/bin/cli.js +323 -81
  13. package/commands/build.md +2 -8
  14. package/commands/checkpoint.md +3 -1
  15. package/commands/code-simplify.md +3 -9
  16. package/commands/gauntlet.md +7 -0
  17. package/commands/handoff.md +3 -1
  18. package/commands/keeper.md +3 -3
  19. package/commands/kill.md +11 -0
  20. package/commands/plan.md +2 -13
  21. package/commands/retro.md +15 -0
  22. package/commands/review.md +1 -1
  23. package/commands/ship.md +3 -27
  24. package/commands/spec.md +3 -11
  25. package/commands/test.md +2 -9
  26. package/commands/webperf.md +7 -0
  27. package/opencode.jsonc +23 -8
  28. package/package.json +3 -3
  29. package/reference/README.md +14 -14
  30. package/reference/auto-mandate.md +11 -0
  31. package/reference/backup-convention.md +9 -0
  32. package/reference/clean-mandate.md +13 -0
  33. package/reference/editor-parity.md +7 -0
  34. package/reference/gc-scripts.md +8 -0
  35. package/reference/intent-routing.md +14 -0
  36. package/reference/lifecycle.md +15 -0
  37. package/reference/model-keeper.md +30 -10
  38. package/reference/model-test.md +13 -8
  39. package/reference/models.md +25 -14
  40. package/reference/oc-source-map.md +162 -0
  41. package/reference/owner-pin.md +31 -0
  42. package/reference/roster.md +15 -0
  43. package/reference/session-scope.md +9 -0
  44. package/reference/session-state.md +13 -0
  45. package/reference/swarm.md +32 -0
  46. package/scripts/backup-config.ps1 +42 -0
  47. package/scripts/gc-branch.ps1 +196 -0
  48. package/scripts/gc-bump.ps1 +198 -0
  49. package/scripts/gc-clean.ps1 +648 -0
  50. package/scripts/gc-commit.ps1 +143 -0
  51. package/scripts/gc-merge.ps1 +272 -0
  52. package/scripts/gc-pr.ps1 +190 -0
  53. package/scripts/gc-push.ps1 +111 -0
  54. package/scripts/gc-read.ps1 +150 -0
  55. package/scripts/gc-rebase.ps1 +162 -0
  56. package/scripts/gc-release.ps1 +225 -0
  57. package/scripts/gc-stage.ps1 +103 -0
  58. package/scripts/gc-status.ps1 +127 -0
  59. package/scripts/gc-sync.ps1 +65 -0
  60. package/scripts/gc.core.ps1 +715 -0
  61. package/scripts/gc.smoke.ps1 +779 -0
  62. package/scripts/harness-doctor.ps1 +11 -9
  63. package/scripts/interrupt-session.ps1 +65 -0
  64. package/scripts/logbook/README.md +108 -0
  65. package/scripts/logbook/logbook.test.ts +440 -0
  66. package/scripts/logbook/logbook.ts +797 -0
  67. package/scripts/pirep/README.md +147 -0
  68. package/scripts/pirep/pirep.test.ts +735 -0
  69. package/scripts/pirep/pirep.ts +836 -0
  70. package/scripts/testflight/README.md +112 -0
  71. package/scripts/testflight/testflight.test.ts +512 -0
  72. package/scripts/testflight/testflight.ts +806 -0
  73. package/skills/_shared/SOURCES.md +7 -7
  74. package/skills/_shared/references/definition-of-done.md +2 -2
  75. package/skills/_shared/references/orchestration-patterns.md +1 -2
  76. package/skills/_shared/references/security-checklist.md +2 -2
  77. package/skills/api-and-interface-design/SKILL.md +7 -360
  78. package/skills/browser-testing-with-devtools/SKILL.md +303 -0
  79. package/skills/code-simplification/SKILL.md +7 -364
  80. package/skills/creative-writing/SKILL.md +1 -1
  81. package/skills/debugging-and-error-recovery/SKILL.md +8 -309
  82. package/skills/flight-deck/SKILL.md +17 -0
  83. package/skills/frontend-ui-engineering/SKILL.md +8 -320
  84. package/skills/gauntlet/SKILL.md +21 -0
  85. package/skills/git-ceremony/SKILL.md +16 -318
  86. package/skills/grilling/SKILL.md +10 -30
  87. package/skills/observability-and-instrumentation/SKILL.md +9 -229
  88. package/skills/performance-optimization/SKILL.md +8 -488
  89. package/skills/pilot-report/SKILL.md +18 -0
  90. package/skills/planning-and-task-breakdown/SKILL.md +8 -249
  91. package/skills/security-and-hardening/SKILL.md +9 -490
  92. package/skills/source-driven-development/SKILL.md +8 -208
  93. package/skills/spec-driven-development/SKILL.md +15 -234
  94. package/skills/test-driven-development/SKILL.md +8 -388
  95. package/skills/test-flight/SKILL.md +14 -0
  96. package/skills/writing-for-agents/SKILL-MECHANICS.md +3 -3
  97. package/skills/writing-for-agents/SKILL.md +7 -1
  98. package/agents/coder.md +0 -19
  99. package/agents/documenter.md +0 -28
  100. package/agents/keeper.md +0 -22
  101. package/agents/master.md +0 -65
  102. package/agents/researcher.md +0 -21
  103. package/agents/security-auditor.md +0 -20
  104. package/agents/test-engineer.md +0 -20
  105. package/agents/web-performance-auditor.md +0 -19
  106. package/commands/council.md +0 -24
  107. package/commands/doctor.md +0 -18
  108. package/commands/ponytail-audit.md +0 -7
  109. package/commands/ponytail-debt.md +0 -14
  110. package/reference/models.md.example +0 -21
  111. package/scripts/panic/panic.ts +0 -240
  112. package/skills/code-review-and-quality/SKILL.md +0 -396
  113. package/skills/incremental-implementation/SKILL.md +0 -249
  114. package/skills/swarm-orchestration/SKILL.md +0 -54
@@ -0,0 +1,198 @@
1
+ #Requires -Version 7.0
2
+ <#
3
+ .SYNOPSIS
4
+ Version bump per ceremony §8: detect the repo's single manifest, apply the
5
+ bump table, justify it, and land the bump as its own commit. No tags, no
6
+ release body, no human in the middle.
7
+
8
+ .DESCRIPTION
9
+ git-ceremony §8 as a script. Rules enforced:
10
+ - one source of truth: exactly one manifest (package.json, pyproject.toml,
11
+ Cargo.toml, or a VERSION file) may exist — two is a repo defect, stop.
12
+ - repo-declared format wins: only 3-part MAJOR.MINOR.PATCH is auto-bumped;
13
+ CalVer, 4-part, or build numbers are refused (repo convention wins, bump
14
+ by hand).
15
+ - the bump table: -Major resets MINOR and PATCH to 0; -Minor resets PATCH
16
+ to 0; -Patch increments PATCH. -Set forces an explicit version.
17
+ - never bump downward, never reuse a version (§8).
18
+ - every bump is justified: -Reason (one line) lands in the bump commit.
19
+ - the bump is its own commit: `chore(release): <old> -> <new>`; a dirty
20
+ tree is refused, and the bump refuses to commit on the default branch
21
+ (the release commit ships through a PR, §6/§11b).
22
+ Write-back is text-preserving (only the version value changes), verified by
23
+ re-reading the manifest before the commit.
24
+
25
+ .PARAMETER Major
26
+ Breaking API or behavior change (resets MINOR, PATCH).
27
+ .PARAMETER Minor
28
+ New backward-compatible capability (resets PATCH).
29
+ .PARAMETER Patch
30
+ Bug fix, no new surface.
31
+ .PARAMETER Set
32
+ Explicit target version MAJOR.MINOR.PATCH (still justified, still no
33
+ downward moves).
34
+ .PARAMETER Reason
35
+ Required one-line justification — what kind of change forced which digit.
36
+ .PARAMETER RepoRoot
37
+ Repository path (defaults to the current directory); git is always pinned
38
+ with git -C.
39
+ .PARAMETER Detailed
40
+ Restore the step narration, ok/info lines, and raw git/gh relay the terse
41
+ default hides. Never affects the RESULT line, warnings, failures, or the
42
+ security/remediation lines.
43
+ .PARAMETER Quiet
44
+ Accepted for compatibility and now a no-op: the default is already terse.
45
+ -Quiet forces the gate closed and so wins if passed with -Detailed.
46
+
47
+ .EXAMPLE
48
+ pwsh -File scripts\gc-bump.ps1 -Minor -Reason 'adds token refresh endpoint (backward compatible)'
49
+ #>
50
+ param(
51
+ [switch]$Major,
52
+ [switch]$Minor,
53
+ [switch]$Patch,
54
+ [string]$Set,
55
+ [Parameter(Mandatory)][string]$Reason,
56
+ [string]$RepoRoot = (Get-Location).Path,
57
+ [switch]$Detailed,
58
+ [switch]$Quiet
59
+ )
60
+ Set-StrictMode -Version Latest
61
+ $ErrorActionPreference = 'Stop'
62
+ . (Join-Path $PSScriptRoot 'gc.core.ps1')
63
+ if ($Detailed) { $script:GcQuiet = $false }
64
+ if ($Quiet) { $script:GcQuiet = $true }
65
+
66
+ function Get-GcManifestEncoding {
67
+ <# detect the manifest's byte-encoding (BOM/UTF-16) so write-back preserves
68
+ it — the "only the version value changes" promise must survive. #>
69
+ param([Parameter(Mandatory)][string]$Path)
70
+ $bytes = [System.IO.File]::ReadAllBytes($Path)
71
+ if ($bytes.Length -ge 3 -and $bytes[0] -eq 0xEF -and $bytes[1] -eq 0xBB -and $bytes[2] -eq 0xBF) { return @{ Enc = [System.Text.UTF8Encoding]::new($true); Name = 'utf8-bom' } }
72
+ if ($bytes.Length -ge 2 -and $bytes[0] -eq 0xFF -and $bytes[1] -eq 0xFE) { return @{ Enc = [System.Text.UnicodeEncoding]::new($false, $true); Name = 'utf16-le' } }
73
+ if ($bytes.Length -ge 2 -and $bytes[0] -eq 0xFE -and $bytes[1] -eq 0xFF) { return @{ Enc = [System.Text.UnicodeEncoding]::new($true, $true); Name = 'utf16-be' } }
74
+ return @{ Enc = [System.Text.UTF8Encoding]::new($false); Name = 'utf8' }
75
+ }
76
+
77
+ function Read-GcVersion {
78
+ param([Parameter(Mandatory)][string]$Root, [Parameter(Mandatory)][string]$Manifest, [Parameter(Mandatory)][hashtable]$Encoding)
79
+ $abs = Join-Path $Root $Manifest
80
+ $enc = $Encoding.Enc
81
+ $content = $enc.GetString([System.IO.File]::ReadAllBytes($abs))
82
+ switch -Regex ($Manifest) {
83
+ 'package\.json$' {
84
+ if ($content -notmatch '"version"\s*:\s*"([^"]+)"') { throw [GcException]::new("package.json has no version field — repo defect", $script:GcExitPre) }
85
+ return $Matches[1]
86
+ }
87
+ '\.toml$' {
88
+ if ($content -notmatch '(?m)^version\s*=\s*"([^"]+)"') { throw [GcException]::new("$Manifest has no top-level version entry — repo defect", $script:GcExitPre) }
89
+ return $Matches[1]
90
+ }
91
+ '^VERSION$' {
92
+ $v = $content.Trim()
93
+ if (-not $v) { throw [GcException]::new('VERSION file is empty — repo defect', $script:GcExitPre) }
94
+ return $v
95
+ }
96
+ default { throw [GcException]::new("unsupported manifest: $Manifest", $script:GcExitPre) }
97
+ }
98
+ }
99
+
100
+ function Write-GcVersion {
101
+ param([Parameter(Mandatory)][string]$Root, [Parameter(Mandatory)][string]$Manifest, [Parameter(Mandatory)][string]$Old, [Parameter(Mandatory)][string]$New, [Parameter(Mandatory)][hashtable]$Encoding)
102
+ $abs = Join-Path $Root $Manifest
103
+ $enc = $Encoding.Enc
104
+ $content = $enc.GetString([System.IO.File]::ReadAllBytes($abs))
105
+ switch -Regex ($Manifest) {
106
+ 'package\.json$' {
107
+ $content = $content -replace '("version"\s*:\s*")[^"]+(")', "`${1}$New`${2}"
108
+ }
109
+ '\.toml$' {
110
+ $content = $content -replace '(?m)^(version\s*=\s*")[^"]+(")', "`${1}$New`${2}"
111
+ }
112
+ '^VERSION$' {
113
+ $content = $New + "`n"
114
+ }
115
+ }
116
+ [System.IO.File]::WriteAllBytes($abs, $enc.GetBytes($content))
117
+ # verify the write-back, never trust the replace
118
+ $readBack = Read-GcVersion -Root $Root -Manifest $Manifest -Encoding $Encoding
119
+ if ($readBack -ne $New) {
120
+ throw [GcException]::new("write-back verification failed — manifest reads '$readBack', expected '$New'; nothing was committed", $script:GcExitFail)
121
+ }
122
+ }
123
+
124
+ try {
125
+ $root = Resolve-GcRoot -Path $RepoRoot
126
+ Write-GcInfo "repo: $root"
127
+
128
+ $cur = Get-GcCurrentBranch -Root $root
129
+ $default = Get-GcDefaultBranch -Root $root
130
+ if ($cur -eq $default) {
131
+ throw [GcException]::new("refusing to bump on the default branch ($default) — the release commit ships through a PR (§6/§11b); gc-branch first", $script:GcExitPre)
132
+ }
133
+
134
+ # exactly one bump direction
135
+ $flags = @([bool]$Major, [bool]$Minor, [bool]$Patch)
136
+ $given = @($flags | Where-Object { $_ }).Count + $(if ($Set) { 1 } else { 0 })
137
+ if ($given -ne 1) {
138
+ throw [GcException]::new('pick exactly one: -Major, -Minor, -Patch, or -Set <version>', $script:GcExitPre)
139
+ }
140
+ if ($Reason -match '\r?\n' -or $Reason.Length -gt 200) {
141
+ throw [GcException]::new('-Reason must be one line, ≤200 chars', $script:GcExitPre)
142
+ }
143
+
144
+ # one source of truth (§8)
145
+ $manifests = @(@('package.json','pyproject.toml','Cargo.toml','VERSION') | Where-Object { Test-Path -LiteralPath (Join-Path $root $_) })
146
+ if (-not $manifests) {
147
+ throw [GcException]::new('no version manifest found — expected package.json, pyproject.toml, Cargo.toml, or a VERSION file', $script:GcExitPre)
148
+ }
149
+ if (@($manifests).Count -gt 1) {
150
+ throw [GcException]::new("multiple manifests ($($manifests -join ', ')) — two sources of truth; fix before bumping (§8)", $script:GcExitPre)
151
+ }
152
+ $manifest = $manifests[0]
153
+
154
+ $manifestAbs = Join-Path $root $manifest
155
+ $manifestEnc = Get-GcManifestEncoding -Path $manifestAbs
156
+ $old = Read-GcVersion -Root $root -Manifest $manifest -Encoding $manifestEnc
157
+ if ($old -notmatch '^\d+\.\d+\.\d+$') {
158
+ throw [GcException]::new("repo version '$old' is not MAJOR.MINOR.PATCH — repo-declared format wins; bump it by hand (§8)", $script:GcExitPre)
159
+ }
160
+
161
+ $maj, $min, $pat = $old -split '\.' | ForEach-Object { [int]$_ }
162
+ if ($Set) {
163
+ if ($Set -notmatch '^\d+\.\d+\.\d+$') { throw [GcException]::new("-Set must be MAJOR.MINOR.PATCH", $script:GcExitPre) }
164
+ $new = $Set; $kind = 'set'
165
+ } elseif ($Major) { $maj++; $new = "$maj.0.0"; $kind = 'major' }
166
+ elseif ($Minor) { $min++; $new = "$maj.$min.0"; $kind = 'minor' }
167
+ else { $pat++; $new = "$maj.$min.$pat"; $kind = 'patch' }
168
+
169
+ if ([version]$new -le [version]$old) {
170
+ throw [GcException]::new("$new is not above $old — never bump downward, never reuse a version (§8)", $script:GcExitPre)
171
+ }
172
+
173
+ # the bump is its own commit — a dirty tree is refused, not mixed in
174
+ if (-not (Test-GcCleanTree -Root $root)) {
175
+ throw [GcException]::new('tree is not clean — the bump must be its own commit; commit or stash the feature work first (§8)', $script:GcExitPre)
176
+ }
177
+ Assert-GcIdentity -Root $root
178
+
179
+ Write-GcInfo "bumping ${manifest}: $old -> $new ($kind)"
180
+ Write-GcVersion -Root $root -Manifest $manifest -Old $old -New $new -Encoding $manifestEnc
181
+
182
+ $subject = "chore(release): $old -> $new"
183
+ Get-GcSubjectParts -Subject $subject | Out-Null # ceremony-valid message
184
+ $argv = @('commit','-m',$subject,'-m',"-${kind}: $Reason")
185
+ Invoke-GcGit -Root $root -Argv (@('add','--',$manifest))
186
+ Stop-GcOnSecrets -Root $root # same gate as gc-commit — a manifest must never smuggle a secret
187
+ Invoke-GcGit -Root $root -Argv $argv
188
+
189
+ $sha = (Get-GcGit -Root $root -Argv @('rev-parse','--short','HEAD') | Select-Object -First 1).Trim()
190
+ Write-GcOk "$subject @ $sha"
191
+ Write-GcResult -Props @{ manifest = $manifest; old = $old; new = $new; kind = $kind; reason = $Reason; sha = $sha; action = 'bumped' }
192
+ } catch [GcException] {
193
+ Write-GcFail $_.Exception.Message
194
+ Write-GcResult -Code $_.Exception.Code -Props @{ message = $_.Exception.Message }
195
+ } catch {
196
+ Write-GcFail "unexpected: $($_.Exception.Message)"
197
+ Write-GcResult -Code $script:GcExitFail -Props @{ message = $_.Exception.Message }
198
+ }