@julioborges/gantry 0.1.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/.agents/skills/gantry/SKILL.md +166 -0
- package/.agents/skills/gantry/capabilities/claude-code.json +15 -0
- package/.agents/skills/gantry/capabilities/codex.json +14 -0
- package/.agents/skills/gantry/capabilities/opencode.json +15 -0
- package/.agents/skills/gantry/dashboard/static/app.js +100 -0
- package/.agents/skills/gantry/dashboard/static/index.html +16 -0
- package/.agents/skills/gantry/dashboard/static/style.css +74 -0
- package/.agents/skills/gantry/hooks/claude-code.settings.json +56 -0
- package/.agents/skills/gantry/hooks/codex.hooks.json +4 -0
- package/.agents/skills/gantry/hooks/git/pre-commit +77 -0
- package/.agents/skills/gantry/hooks/git/pre-push +123 -0
- package/.agents/skills/gantry/hooks/git/skipscan.py +88 -0
- package/.agents/skills/gantry/hooks/opencode.plugin.js +44 -0
- package/.agents/skills/gantry/reference/plan-workflow.md +383 -0
- package/.agents/skills/gantry/reference/round-workflow.md +755 -0
- package/.agents/skills/gantry/schemas/critic.json +93 -0
- package/.agents/skills/gantry/schemas/implementer.json +52 -0
- package/.agents/skills/gantry/schemas/learner.json +35 -0
- package/.agents/skills/gantry/schemas/plan-critic.json +39 -0
- package/.agents/skills/gantry/schemas/planner.json +64 -0
- package/.agents/skills/gantry/schemas/requirement-critic.json +48 -0
- package/.agents/skills/gantry/schemas/reviewer.json +52 -0
- package/.agents/skills/gantry/scripts/acceptance.py +66 -0
- package/.agents/skills/gantry/scripts/budget.py +162 -0
- package/.agents/skills/gantry/scripts/cleanup.py +186 -0
- package/.agents/skills/gantry/scripts/common.py +361 -0
- package/.agents/skills/gantry/scripts/dashboard.py +233 -0
- package/.agents/skills/gantry/scripts/frontier.py +192 -0
- package/.agents/skills/gantry/scripts/gates.py +401 -0
- package/.agents/skills/gantry/scripts/guard.py +568 -0
- package/.agents/skills/gantry/scripts/learner.py +99 -0
- package/.agents/skills/gantry/scripts/result.py +104 -0
- package/.agents/skills/gantry/scripts/roadmap.py +212 -0
- package/.agents/skills/gantry/scripts/runlog.py +491 -0
- package/.agents/skills/gantry/scripts/setup.py +139 -0
- package/.agents/skills/gantry/scripts/spec.py +252 -0
- package/.agents/skills/gantry/templates/issue.md +32 -0
- package/.agents/skills/gantry/templates/prd.md +26 -0
- package/.agents/skills/gantry/templates/spec.md +48 -0
- package/.agents/skills/gantry-dashboard/SKILL.md +55 -0
- package/.agents/skills/gantry-setup/SKILL.md +30 -0
- package/LICENSE +201 -0
- package/README.md +437 -0
- package/bin/gantry.mjs +45 -0
- package/package.json +36 -0
- package/scripts/ensure-npm-author.mjs +29 -0
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""Validate a Spec's structure against its effective template."""
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import json
|
|
7
|
+
import re
|
|
8
|
+
import sys
|
|
9
|
+
from pathlib import Path
|
|
10
|
+
|
|
11
|
+
sys.path.insert(0, str(Path(__file__).parent))
|
|
12
|
+
from common import repo_root, resolve_effective_template, resolve_heading_map # noqa: E402
|
|
13
|
+
|
|
14
|
+
HEADING_RE = re.compile(r"^##(?!#)[ \t]+(.+?)[ \t]*$", re.MULTILINE)
|
|
15
|
+
SCENARIO_RE = re.compile(r"^[ \t]*Scenario:[ \t]*(.+?)[ \t]*$", re.MULTILINE)
|
|
16
|
+
STEP_RE = re.compile(r"^[ \t]*(Given|When|Then|And|But)[ \t]+(.+?)[ \t]*$")
|
|
17
|
+
PLACEHOLDER_RE = re.compile(r"<[^>\n]+>|YYYY-MM-DD")
|
|
18
|
+
DESCRIPTIVE_PLACEHOLDER_RE = re.compile(r"<[A-Za-z0-9](?:[^>\n]*[ \t][^>\n]*)\S>")
|
|
19
|
+
FENCE_RE = re.compile(r"^\s*(?:`{3,}|~{3,})(.*)$")
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def headings(text: str) -> list[str]:
|
|
23
|
+
"""Return the document's level-two Markdown headings."""
|
|
24
|
+
outside_fences: list[str] = []
|
|
25
|
+
fenced = False
|
|
26
|
+
for line in text.splitlines(keepends=True):
|
|
27
|
+
if re.match(r"^\s*(?:`{3,}|~{3,})", line):
|
|
28
|
+
fenced = not fenced
|
|
29
|
+
elif not fenced:
|
|
30
|
+
outside_fences.append(line)
|
|
31
|
+
return [f"## {match.group(1)}" for match in HEADING_RE.finditer("".join(outside_fences))]
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
def scenario_blocks(text: str) -> tuple[list[tuple[int, str]], list[list[tuple[int, str]]]]:
|
|
35
|
+
"""Return unfenced and Gherkin-fenced lines with original line numbers."""
|
|
36
|
+
unfenced: list[tuple[int, str]] = []
|
|
37
|
+
gherkin_blocks: list[list[tuple[int, str]]] = []
|
|
38
|
+
current_block: list[tuple[int, str]] = []
|
|
39
|
+
fenced = False
|
|
40
|
+
gherkin = False
|
|
41
|
+
for line_number, line in enumerate(text.splitlines(), 1):
|
|
42
|
+
fence = FENCE_RE.match(line)
|
|
43
|
+
if fence:
|
|
44
|
+
if not fenced:
|
|
45
|
+
gherkin = fence.group(1).strip().casefold() == "gherkin"
|
|
46
|
+
else:
|
|
47
|
+
if gherkin:
|
|
48
|
+
gherkin_blocks.append(current_block)
|
|
49
|
+
current_block = []
|
|
50
|
+
gherkin = False
|
|
51
|
+
fenced = not fenced
|
|
52
|
+
elif gherkin:
|
|
53
|
+
current_block.append((line_number, line))
|
|
54
|
+
elif not fenced:
|
|
55
|
+
unfenced.append((line_number, line))
|
|
56
|
+
if gherkin:
|
|
57
|
+
gherkin_blocks.append(current_block)
|
|
58
|
+
return unfenced, gherkin_blocks
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
def scenario_matches(lines: list[tuple[int, str]]) -> list[tuple[int, re.Match[str]]]:
|
|
62
|
+
"""Locate Scenario headers in one validation context."""
|
|
63
|
+
return [(index, match) for index, (_, line) in enumerate(lines) if (match := SCENARIO_RE.match(line))]
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
def validate_scenario_block(
|
|
67
|
+
lines: list[tuple[int, str]], strict: bool
|
|
68
|
+
) -> list[dict[str, object]]:
|
|
69
|
+
"""Check the scenarios in one unfenced or Gherkin-fenced block."""
|
|
70
|
+
malformed: list[dict[str, object]] = []
|
|
71
|
+
matches = scenario_matches(lines)
|
|
72
|
+
for index, (start, match) in enumerate(matches):
|
|
73
|
+
end = matches[index + 1][0] if index + 1 < len(matches) else len(lines)
|
|
74
|
+
phase: str | None = None
|
|
75
|
+
errors: list[tuple[int, str]] = []
|
|
76
|
+
for line_number, line in lines[start + 1:end]:
|
|
77
|
+
stripped = line.strip()
|
|
78
|
+
if not stripped or stripped.startswith("#"):
|
|
79
|
+
continue
|
|
80
|
+
step = STEP_RE.match(line)
|
|
81
|
+
if step is None:
|
|
82
|
+
if strict:
|
|
83
|
+
errors.append((line_number, "Scenario contains invalid Gherkin line"))
|
|
84
|
+
continue
|
|
85
|
+
|
|
86
|
+
kind = step.group(1)
|
|
87
|
+
if kind == "Given":
|
|
88
|
+
if phase in {None, "given"}:
|
|
89
|
+
phase = "given"
|
|
90
|
+
else:
|
|
91
|
+
errors.append((line_number, "Given cannot follow When or Then"))
|
|
92
|
+
elif kind == "When":
|
|
93
|
+
if phase == "given":
|
|
94
|
+
phase = "when"
|
|
95
|
+
else:
|
|
96
|
+
errors.append((line_number, "When must follow Given and precede Then"))
|
|
97
|
+
elif kind == "Then":
|
|
98
|
+
if phase == "when":
|
|
99
|
+
phase = "then"
|
|
100
|
+
else:
|
|
101
|
+
errors.append((line_number, "Then must follow When"))
|
|
102
|
+
elif phase is None:
|
|
103
|
+
errors.append((line_number, "And or But must follow Given, When or Then"))
|
|
104
|
+
|
|
105
|
+
if phase != "then":
|
|
106
|
+
errors.append((lines[start][0], "Scenario must end with Then steps"))
|
|
107
|
+
for line_number, reason in errors:
|
|
108
|
+
malformed.append(
|
|
109
|
+
{
|
|
110
|
+
"line": line_number,
|
|
111
|
+
"scenario": match.group(1),
|
|
112
|
+
"reason": reason,
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
return malformed
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+
def canonical_heading(heading: str, heading_map: dict[str, str]) -> str:
|
|
119
|
+
"""Translate one declared equivalent heading to its template heading."""
|
|
120
|
+
if heading in heading_map:
|
|
121
|
+
return heading_map[heading]
|
|
122
|
+
lowered = heading.casefold()
|
|
123
|
+
for alias, canonical in heading_map.items():
|
|
124
|
+
if alias.casefold() == lowered:
|
|
125
|
+
return canonical
|
|
126
|
+
return heading
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def validate_scenarios(text: str, required: bool) -> list[dict[str, object]]:
|
|
130
|
+
"""Check Gherkin-fenced scenarios for ordered Given, When and Then steps."""
|
|
131
|
+
_, gherkin_blocks = scenario_blocks(text)
|
|
132
|
+
if required and not any(scenario_matches(block) for block in gherkin_blocks):
|
|
133
|
+
return [{"line": None, "reason": "expected at least one Scenario with Given, When and Then steps"}]
|
|
134
|
+
|
|
135
|
+
return [
|
|
136
|
+
finding
|
|
137
|
+
for block in gherkin_blocks
|
|
138
|
+
for finding in validate_scenario_block(block, True)
|
|
139
|
+
]
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
def validate(spec: Path, root: Path) -> dict[str, object]:
|
|
143
|
+
"""Produce every structural finding for one Spec."""
|
|
144
|
+
template = resolve_effective_template(root, "spec")
|
|
145
|
+
template_text = template.read_text(encoding="utf-8")
|
|
146
|
+
text = spec.read_text(encoding="utf-8")
|
|
147
|
+
required = headings(template_text)
|
|
148
|
+
heading_map = resolve_heading_map(root)
|
|
149
|
+
actual = headings(text)
|
|
150
|
+
present: list[dict[str, str]] = []
|
|
151
|
+
positions: list[tuple[str, int]] = []
|
|
152
|
+
missing: list[str] = []
|
|
153
|
+
|
|
154
|
+
for expected in required:
|
|
155
|
+
match = next(
|
|
156
|
+
(
|
|
157
|
+
(position, heading)
|
|
158
|
+
for position, heading in enumerate(actual)
|
|
159
|
+
if canonical_heading(heading, heading_map).casefold() == expected.casefold()
|
|
160
|
+
),
|
|
161
|
+
None,
|
|
162
|
+
)
|
|
163
|
+
if match is None:
|
|
164
|
+
missing.append(expected)
|
|
165
|
+
else:
|
|
166
|
+
position, heading = match
|
|
167
|
+
present.append({"expected": expected, "actual": heading})
|
|
168
|
+
positions.append((expected, position))
|
|
169
|
+
|
|
170
|
+
out_of_order: list[dict[str, str]] = []
|
|
171
|
+
for (previous, previous_position), (current, current_position) in zip(positions, positions[1:]):
|
|
172
|
+
if current_position < previous_position:
|
|
173
|
+
out_of_order.append(
|
|
174
|
+
{
|
|
175
|
+
"expected": current,
|
|
176
|
+
"found_after": previous,
|
|
177
|
+
"actual": next(item["actual"] for item in present if item["expected"] == current),
|
|
178
|
+
}
|
|
179
|
+
)
|
|
180
|
+
|
|
181
|
+
template_placeholders = set(PLACEHOLDER_RE.findall(template_text))
|
|
182
|
+
detects_descriptive_placeholders = any(
|
|
183
|
+
DESCRIPTIVE_PLACEHOLDER_RE.fullmatch(placeholder)
|
|
184
|
+
for placeholder in template_placeholders
|
|
185
|
+
)
|
|
186
|
+
placeholders = [
|
|
187
|
+
{"line": text[:match.start()].count("\n") + 1, "text": match.group(0)}
|
|
188
|
+
for match in PLACEHOLDER_RE.finditer(text)
|
|
189
|
+
if match.group(0) in template_placeholders
|
|
190
|
+
or (
|
|
191
|
+
detects_descriptive_placeholders
|
|
192
|
+
and DESCRIPTIVE_PLACEHOLDER_RE.fullmatch(match.group(0))
|
|
193
|
+
)
|
|
194
|
+
]
|
|
195
|
+
malformed_scenarios = validate_scenarios(text, "Scenario:" in template_text)
|
|
196
|
+
valid = not any((missing, out_of_order, placeholders, malformed_scenarios))
|
|
197
|
+
return {
|
|
198
|
+
"spec": str(spec),
|
|
199
|
+
"template": str(template),
|
|
200
|
+
"required_headings": required,
|
|
201
|
+
"present": present,
|
|
202
|
+
"missing": missing,
|
|
203
|
+
"out_of_order": out_of_order,
|
|
204
|
+
"placeholders": placeholders,
|
|
205
|
+
"malformed_scenarios": malformed_scenarios,
|
|
206
|
+
"valid": valid,
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
|
|
210
|
+
def main() -> int:
|
|
211
|
+
parser = argparse.ArgumentParser(description=__doc__)
|
|
212
|
+
parser.add_argument("--check", action="store_true", help="validate the supplied Spec")
|
|
213
|
+
parser.add_argument("spec", nargs="?", help="Spec path")
|
|
214
|
+
parser.add_argument("--cwd", default=".", help="repository or worktree containing the policy")
|
|
215
|
+
parser.add_argument("--json", action="store_true", help="print machine-readable findings")
|
|
216
|
+
args = parser.parse_args()
|
|
217
|
+
if not args.check or not args.spec:
|
|
218
|
+
parser.print_usage(sys.stderr)
|
|
219
|
+
return 2
|
|
220
|
+
|
|
221
|
+
root = repo_root(Path(args.cwd))
|
|
222
|
+
spec = Path(args.spec)
|
|
223
|
+
spec = spec if spec.is_absolute() else root / spec
|
|
224
|
+
if not spec.is_file():
|
|
225
|
+
payload = {"spec": str(spec), "error": "Spec is not a readable file"}
|
|
226
|
+
if args.json:
|
|
227
|
+
print(json.dumps(payload, indent=2))
|
|
228
|
+
else:
|
|
229
|
+
print(f"Spec is not a readable file: {spec}", file=sys.stderr)
|
|
230
|
+
return 2
|
|
231
|
+
|
|
232
|
+
try:
|
|
233
|
+
payload = validate(spec.resolve(), root)
|
|
234
|
+
except (OSError, UnicodeError, ValueError) as exc:
|
|
235
|
+
payload = {"spec": str(spec), "error": str(exc)}
|
|
236
|
+
if args.json:
|
|
237
|
+
print(json.dumps(payload, indent=2))
|
|
238
|
+
else:
|
|
239
|
+
print(f"Spec cannot be validated: {exc}", file=sys.stderr)
|
|
240
|
+
return 2
|
|
241
|
+
if args.json:
|
|
242
|
+
print(json.dumps(payload, indent=2))
|
|
243
|
+
else:
|
|
244
|
+
print("valid" if payload["valid"] else "invalid")
|
|
245
|
+
for key in ("missing", "out_of_order", "placeholders", "malformed_scenarios"):
|
|
246
|
+
for finding in payload[key]:
|
|
247
|
+
print(f"{key}: {finding}")
|
|
248
|
+
return 0 if payload["valid"] else 1
|
|
249
|
+
|
|
250
|
+
|
|
251
|
+
if __name__ == "__main__":
|
|
252
|
+
sys.exit(main())
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# <Issue title>
|
|
2
|
+
|
|
3
|
+
Type: issue
|
|
4
|
+
Status: draft
|
|
5
|
+
Slice: `<spec-slug>#NN`
|
|
6
|
+
Spec: `<spec path>`
|
|
7
|
+
Created: YYYY-MM-DD
|
|
8
|
+
|
|
9
|
+
## Parent
|
|
10
|
+
|
|
11
|
+
`<spec-slug>`
|
|
12
|
+
|
|
13
|
+
## What to build
|
|
14
|
+
|
|
15
|
+
<One complete, demonstrable behaviour.>
|
|
16
|
+
|
|
17
|
+
### Files to read
|
|
18
|
+
|
|
19
|
+
List every additional initial-context file here. Each item must be exactly one
|
|
20
|
+
repository-relative path in a code span; only this list is counted in the context budget.
|
|
21
|
+
|
|
22
|
+
- `<repository-relative-path>`
|
|
23
|
+
|
|
24
|
+
## Acceptance criteria
|
|
25
|
+
|
|
26
|
+
- [ ] <Observable behaviour with runnable proof.>
|
|
27
|
+
|
|
28
|
+
## Blocked by
|
|
29
|
+
|
|
30
|
+
- None
|
|
31
|
+
|
|
32
|
+
## Comments
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# Product Requirements: <product>
|
|
2
|
+
|
|
3
|
+
Status: draft
|
|
4
|
+
Created: YYYY-MM-DD
|
|
5
|
+
|
|
6
|
+
## 1. Problem
|
|
7
|
+
|
|
8
|
+
<Problem and evidence.>
|
|
9
|
+
|
|
10
|
+
## 2. Principles
|
|
11
|
+
|
|
12
|
+
1. <Principle that guides delivery.>
|
|
13
|
+
|
|
14
|
+
## 3. Scope
|
|
15
|
+
|
|
16
|
+
| In scope | Out of scope |
|
|
17
|
+
|---|---|
|
|
18
|
+
| <Delivery> | <Explicit exclusion> |
|
|
19
|
+
|
|
20
|
+
## 4. Success measures
|
|
21
|
+
|
|
22
|
+
- <Observable measure.>
|
|
23
|
+
|
|
24
|
+
## 5. Risks and decisions
|
|
25
|
+
|
|
26
|
+
- <Open decision or accepted risk.>
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Spec: <feature>
|
|
2
|
+
|
|
3
|
+
Type: spec
|
|
4
|
+
Status: draft
|
|
5
|
+
Map: `ROADMAP.md` (spec NN)
|
|
6
|
+
Source: <product source>
|
|
7
|
+
Created: YYYY-MM-DD
|
|
8
|
+
|
|
9
|
+
## Blueprint
|
|
10
|
+
|
|
11
|
+
### Context
|
|
12
|
+
|
|
13
|
+
<Problem, users and current state.>
|
|
14
|
+
|
|
15
|
+
### Architecture
|
|
16
|
+
|
|
17
|
+
<Boundaries, contracts and implementation shape.>
|
|
18
|
+
|
|
19
|
+
### Constraints
|
|
20
|
+
|
|
21
|
+
<Positive, measurable constraints.>
|
|
22
|
+
|
|
23
|
+
## Contract
|
|
24
|
+
|
|
25
|
+
### Definition of Done
|
|
26
|
+
|
|
27
|
+
- [ ] <Observable delivery outcome.>
|
|
28
|
+
|
|
29
|
+
### Regression Guardrails
|
|
30
|
+
|
|
31
|
+
- <Behaviour that must remain true.>
|
|
32
|
+
|
|
33
|
+
### Scenarios
|
|
34
|
+
|
|
35
|
+
```gherkin
|
|
36
|
+
Scenario: <observable behaviour>
|
|
37
|
+
Given <context>
|
|
38
|
+
When <action>
|
|
39
|
+
Then <outcome>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
## Out of Scope
|
|
43
|
+
|
|
44
|
+
- <Excluded work and reason.>
|
|
45
|
+
|
|
46
|
+
## Changelog
|
|
47
|
+
|
|
48
|
+
- YYYY-MM-DD — Initial draft.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gantry-dashboard
|
|
3
|
+
description: Opens a read-only, loopback-only kanban dashboard that shows every Gantry Run across every execution unit of the current Git clone — one swimlane per Run, Issues placed in Ready, Plan, Implement, Review, Critic, Integrate, Done and Blocked columns. Use for "open the dashboard", "show me the runs", "is anything stuck", "which run is stale".
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Gantry Dashboard
|
|
7
|
+
|
|
8
|
+
A local HTTP server that renders the Run log `runlog.py` already writes. It never decides
|
|
9
|
+
anything and never writes anything: every route is a `GET`, and the page polls
|
|
10
|
+
`GET /api/state` to redraw itself. No Issue, policy, Run log, branch or worktree can be
|
|
11
|
+
changed from the dashboard.
|
|
12
|
+
|
|
13
|
+
## Open the dashboard
|
|
14
|
+
|
|
15
|
+
```
|
|
16
|
+
python3 <skillDir>/../gantry/scripts/dashboard.py serve
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
- Binds `127.0.0.1` only; the script refuses any other `--host` value and exits non-zero
|
|
20
|
+
before opening a socket. There is no way to expose the dashboard beyond the local machine.
|
|
21
|
+
- Defaults to port `4600`; pass `--port 0` for an OS-assigned ephemeral port (the script
|
|
22
|
+
prints the resolved `host`/`port`/`stateRoot` as one JSON line before it starts serving).
|
|
23
|
+
- Reads Run logs from `~/.gantry/state/<unit-id>/runs/*.jsonl` by default (every worktree of
|
|
24
|
+
one clone shares that state root); pass `--state-root` to point at a different one, for
|
|
25
|
+
example when inspecting a fixture.
|
|
26
|
+
- Open `http://127.0.0.1:<port>/` in a browser once the server is listening.
|
|
27
|
+
|
|
28
|
+
## What you see
|
|
29
|
+
|
|
30
|
+
- One swimlane per Run (`<repositoryRoot> — <run> [tier: …]`), across every execution unit
|
|
31
|
+
under the state root — a Run started from one clone shows next to a Run from another.
|
|
32
|
+
- Each Issue card sits in the column matching its most recent `phase.started` phase, or
|
|
33
|
+
`Done`/`Blocked` once `issue.done`/`issue.blocked` is logged.
|
|
34
|
+
- Card badges: branch or worktree, per-role models, correction budget (used/ceiling), elapsed
|
|
35
|
+
time in the current phase, and whether the Run is waiting on the operator.
|
|
36
|
+
- A swimlane is marked stale when its last non-`policy.changed` event is older than the
|
|
37
|
+
`staleAfterSeconds` value recorded on that Run's own `run.started` event — the snapshot
|
|
38
|
+
taken when the Run started, never the repository's current policy and never a later
|
|
39
|
+
`policy.changed` event.
|
|
40
|
+
|
|
41
|
+
## Verify it without a browser
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
python3 -m unittest tests/test_dashboard.py -v
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
The test module and `dashboard.py` both import only the Python standard library (`argparse`,
|
|
48
|
+
`datetime`, `http.server`, `json`, `pathlib`, `threading`, `time`, `urllib`, plus the pack's
|
|
49
|
+
own `runlog` module) — no third-party dependency is required to run either the server or its
|
|
50
|
+
tests.
|
|
51
|
+
|
|
52
|
+
## Stopping the server
|
|
53
|
+
|
|
54
|
+
`Ctrl-C` in the terminal running `dashboard.py serve` stops it; nothing it does needs
|
|
55
|
+
cleanup, because it never wrote anything.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: gantry-setup
|
|
3
|
+
description: Conversational repository setup. The sole writer of repository policy and its marked AGENTS.md section.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Gantry Setup
|
|
7
|
+
|
|
8
|
+
You are the sole conversational writer of repository policy.
|
|
9
|
+
|
|
10
|
+
1. **Present Decisions**: Present each artifact, template, check, Git, and hook decision to the operator.
|
|
11
|
+
- For each decision, provide its benefit, trade-off, default, and confirmation.
|
|
12
|
+
- Preserves pack defaults when skipped.
|
|
13
|
+
|
|
14
|
+
2. **Capabilities & Hooks**:
|
|
15
|
+
- Reads capability declarations (from `.agents/skills/gantry/capabilities/*.json`) to offer only supported hook choices.
|
|
16
|
+
- Enables recording by default.
|
|
17
|
+
- Asks before denial hooks.
|
|
18
|
+
|
|
19
|
+
3. **Constraints**:
|
|
20
|
+
- Creates no engine, database, MCP service, or automatic cleanup.
|
|
21
|
+
- All setup-generated policy, prompts, and marked content must be English.
|
|
22
|
+
|
|
23
|
+
4. **Applying the Policy**:
|
|
24
|
+
Once the operator confirms the settings, construct the JSON configuration and pipe it to `setup.py`:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
python3 .agents/skills/gantry/scripts/setup.py --config '{...}'
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The `setup.py` script renders the full proposed `.gantry/config.json` before writing, supports merge, overwrite, and abort for an existing policy, handles idempotent merging of the Claude Code hook fragment into `.claude/settings.json`, and adds or replaces only the marked Gantry section in `AGENTS.md`. Do not modify these files directly.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|