assertion-cli 0.5.2__py3-none-any.whl → 0.5.4__py3-none-any.whl
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.
- {assertion_cli-0.5.2.dist-info → assertion_cli-0.5.4.dist-info}/METADATA +1 -1
- assertion_cli-0.5.4.dist-info/RECORD +15 -0
- assertion_cli_templates/ACTIVATION.md +38 -8
- assertion_cli_templates/SKILL.md +11 -3
- git.py +2 -1
- main.py +34 -1
- assertion_cli-0.5.2.dist-info/RECORD +0 -15
- {assertion_cli-0.5.2.dist-info → assertion_cli-0.5.4.dist-info}/WHEEL +0 -0
- {assertion_cli-0.5.2.dist-info → assertion_cli-0.5.4.dist-info}/entry_points.txt +0 -0
- {assertion_cli-0.5.2.dist-info → assertion_cli-0.5.4.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
api.py,sha256=AxwOMHenNpMBNMtkCg39WxDWqBpyrqGbzri4nI3fDis,7117
|
|
2
|
+
bundle.py,sha256=O616zO-SY66J0v2d1NAr3S7cshSmUIAUiYX_sI_dMYo,1515
|
|
3
|
+
git.py,sha256=7pnUlQlbF2YujjbS5v-8Ub5i6fOOIpJcBkRoLezjces,4055
|
|
4
|
+
link.py,sha256=bfH0MhkeTFGbOSJbSvuuw3ilGX3akyvjvCw25AP_fz8,643
|
|
5
|
+
main.py,sha256=3cJVQtGwmo3o_byIgCzdinvG4Z-KFaVHkbxQq-OjoTw,22865
|
|
6
|
+
models.py,sha256=ApnfCO7CF5Nfdy5-ho7U-YRLWM-C3421fAT7GXa4Y30,2269
|
|
7
|
+
session.py,sha256=3oe3GbAaA2ynjk-2DFsLvwlFUMwHNnUmTKkBrQo_8IE,6507
|
|
8
|
+
assertion_cli_templates/ACTIVATION.md,sha256=kLaN23BxL7HmWYs0iqgZ6yI0dVPgoLFnFYvZnogebzo,3019
|
|
9
|
+
assertion_cli_templates/SKILL.md,sha256=huOqBPZW-OJE8R4v9Vxe8WLwPc31dDkpInsb84HkWmQ,16003
|
|
10
|
+
assertion_cli_templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
+
assertion_cli-0.5.4.dist-info/METADATA,sha256=v4ZxPl71KX-i6bXPlXxbbqWlU4Kel1xPFz8G1nE2sVA,1712
|
|
12
|
+
assertion_cli-0.5.4.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
13
|
+
assertion_cli-0.5.4.dist-info/entry_points.txt,sha256=LgwuPLZEIk-4sD7ghGVRQOhm3PG8sPVozMRxrihwMgU,34
|
|
14
|
+
assertion_cli-0.5.4.dist-info/top_level.txt,sha256=xbZYH9xQOa99z-Vbkc2Xp6h8oUR97DVlyczy8H4ZuFc,64
|
|
15
|
+
assertion_cli-0.5.4.dist-info/RECORD,,
|
|
@@ -7,14 +7,44 @@ This repo uses the Assertion CLI (`asrt`) to track user intent and verify your w
|
|
|
7
7
|
|
|
8
8
|
Both files are byte-identical. Read whichever your agent loads (or either one directly). In brief, follow these three rules for every conversation:
|
|
9
9
|
|
|
10
|
-
1. **
|
|
11
|
-
2. **Checkpoint at trajectory-feedback moments**, not
|
|
12
|
-
3. **Verify at completion** with `asrt verify`. If feedback requires changes, iterate and re-verify — do **not** drop back into the checkpoint loop. Once verify is clean, open a PR and **
|
|
10
|
+
1. **Log every user message:** run `asrt prompt "<exact text>"` before anything else, on every turn — it's the verifier's record of intent.
|
|
11
|
+
2. **Checkpoint at trajectory-feedback moments**, not every change. First checkpoint: `asrt stacks`, pick the stack that fits, then `asrt checkpoint --stack <id> "<summary>"`; later ones drop `--stack` and auto-continue. A feature build is a handful of checkpoints.
|
|
12
|
+
3. **Verify at completion** with `asrt verify`. If feedback requires changes, iterate and re-verify — do **not** drop back into the checkpoint loop. Once verify is clean, open a PR — and that PR **must** carry the hidden Assertion session marker (see below).
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
gh pr create --title "<title>" --body "$(printf '%s\n\n%s\n' '<one-paragraph why>' "$(asrt get-link)")"
|
|
16
|
-
```
|
|
14
|
+
---
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
## ⚠️ REQUIRED: every PR must embed the hidden session marker
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
**This is the single most-missed step, and it is not optional.** A PR opened from an Assertion session that omits the marker cannot be linked back to its verification, so the work reads as unverified.
|
|
19
|
+
|
|
20
|
+
The Assertion GitHub bot links a PR to its verification session by **branch name first**. When the branch name doesn't match the one you verified on (you renamed it, the head ref differs, etc.), the bot falls back to reading the marker. No marker → no fallback → no link.
|
|
21
|
+
|
|
22
|
+
`asrt get-link` prints the marker as an HTML comment that GitHub hides from the rendered description but still delivers to the bot in the webhook payload:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
<!-- assertion-session: https://app.tryassertion.com/sessions/<id> -->
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
**Open the PR with the marker embedded** — never paste the bare URL into the visible body; use the command so the format stays exact:
|
|
29
|
+
|
|
30
|
+
```
|
|
31
|
+
gh pr create --title "<title>" --body "$(printf '%s\n\n%s\n' '<one-paragraph why>' "$(asrt get-link)")"
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
If a PR already exists for the branch, add the marker instead of opening a new one:
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
gh pr edit --body "$(printf '%s\n\n%s\n' '<existing summary>' "$(asrt get-link)")"
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
**Then confirm it landed.** The marker won't show in the rendered description — that's expected — so verify it's in the raw body:
|
|
41
|
+
|
|
42
|
+
```
|
|
43
|
+
gh pr view --json body --jq .body | grep -q 'assertion-session:' && echo "marker present" || echo "MARKER MISSING — fix before continuing"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Hard gates (do not bypass)
|
|
49
|
+
- **No PR whose body omits the session marker.** If `asrt get-link` has nothing to return, you haven't verified yet — go back to rule 3.
|
|
50
|
+
- **Confirm the marker after creating/editing the PR** with the `gh pr view` check above. Treat a missing marker as a blocking error, not a warning.
|
assertion_cli_templates/SKILL.md
CHANGED
|
@@ -16,6 +16,8 @@ Before any `asrt` call:
|
|
|
16
16
|
- You are inside a git repository.
|
|
17
17
|
- `asrt init` has been run in this repo. It records the current HEAD as the diff base that every checkpoint/verify diffs against, and installs the skill files you are reading right now. If `asrt checkpoint` or `asrt verify` errors with "No diff base recorded", run `asrt init` and retry.
|
|
18
18
|
|
|
19
|
+
**Starting a fresh session:** when beginning a new session, delete the contents of `.assertion/` first. This clears the previous session's in-flight state (metadata, prompts log, link) so a new session starts clean and anchors to the stack you pick on the first checkpoint. Only the user should do this — it resets the session.
|
|
20
|
+
|
|
19
21
|
Treat `.assertion/metadata.json`, `.assertion/prompts`, and `.assertion/base_sha` as internal state owned by the CLI. Do not create, edit, or delete those files manually — use `asrt prompt` to append to the prompts log.
|
|
20
22
|
|
|
21
23
|
`asrt stacks` is read-only and lists every verification stack in the user's workspace, along with the repo each is configured for. Run it once per session before your first checkpoint so you can pick a stack ID; do not hardcode IDs from memory.
|
|
@@ -179,7 +181,15 @@ EOF
|
|
|
179
181
|
)"
|
|
180
182
|
```
|
|
181
183
|
|
|
182
|
-
|
|
184
|
+
**Enforce it — don't assume it landed.** Immediately after creating or editing the PR, confirm the marker is in the raw body (it won't show in the rendered description — that's expected):
|
|
185
|
+
|
|
186
|
+
```
|
|
187
|
+
gh pr view --json body --jq .body | grep -q 'assertion-session:' \
|
|
188
|
+
&& echo "marker present" \
|
|
189
|
+
|| { echo "MARKER MISSING — re-run gh pr edit with \$(asrt get-link) before continuing"; exit 1; }
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
A missing marker is a **blocking error**, not a warning: do not consider the PR step complete, and do not move on, until this check prints `marker present`. Re-run `gh pr edit` with `$(asrt get-link)` and re-check until it passes.
|
|
183
193
|
|
|
184
194
|
**Do not open a PR without a clean `asrt verify` / `asrt verify-status`, and do not open one whose body omits the session marker.** Do not end a session with a failed/dirty verify unless the verification service itself is unavailable.
|
|
185
195
|
|
|
@@ -200,8 +210,6 @@ asrt get-link # hidden PR marker — embed in th
|
|
|
200
210
|
|
|
201
211
|
## Environment
|
|
202
212
|
|
|
203
|
-
- `ASSERTION_BASE_URL` — point the CLI at a non-default backend (default `http://localhost:8000`).
|
|
204
|
-
|
|
205
213
|
## Non-interactive / harness mode
|
|
206
214
|
|
|
207
215
|
When running under a non-interactive harness (CI, benchmark runner, scripts):
|
git.py
CHANGED
|
@@ -120,6 +120,7 @@ def get_uncommitted_diff(repo_root: Path, base_sha: str) -> str:
|
|
|
120
120
|
]
|
|
121
121
|
|
|
122
122
|
parts = [p for p in [tracked, "\n".join(untracked_diffs)] if p]
|
|
123
|
-
|
|
123
|
+
diff = "\n".join(parts)
|
|
124
|
+
return diff + "\n" if diff else diff
|
|
124
125
|
except RuntimeError as exc:
|
|
125
126
|
exit_with_error(f"Failed to collect git diff: {exc}")
|
main.py
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import base64
|
|
2
|
+
import importlib.metadata
|
|
2
3
|
import importlib.resources
|
|
3
4
|
import json
|
|
4
5
|
import re
|
|
@@ -8,6 +9,27 @@ from pathlib import Path
|
|
|
8
9
|
import httpx
|
|
9
10
|
import typer
|
|
10
11
|
|
|
12
|
+
|
|
13
|
+
_VERSION: str | None = None
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
def _get_version() -> str:
|
|
17
|
+
global _VERSION
|
|
18
|
+
if _VERSION is not None:
|
|
19
|
+
return _VERSION
|
|
20
|
+
try:
|
|
21
|
+
_VERSION = importlib.metadata.version("assertion-cli")
|
|
22
|
+
except importlib.metadata.PackageNotFoundError:
|
|
23
|
+
pyproject = Path(__file__).resolve().parent / "pyproject.toml"
|
|
24
|
+
if pyproject.exists():
|
|
25
|
+
import tomllib
|
|
26
|
+
|
|
27
|
+
data = tomllib.loads(pyproject.read_text(encoding="utf-8"))
|
|
28
|
+
_VERSION = data["project"]["version"]
|
|
29
|
+
else:
|
|
30
|
+
_VERSION = "0.0.0"
|
|
31
|
+
return _VERSION
|
|
32
|
+
|
|
11
33
|
from api import AssertionClient
|
|
12
34
|
from bundle import build_bundle
|
|
13
35
|
from git import (
|
|
@@ -52,8 +74,19 @@ def render_checkpoint_response(resp: CheckpointResponse) -> str:
|
|
|
52
74
|
|
|
53
75
|
|
|
54
76
|
@app.callback(invoke_without_command=True)
|
|
55
|
-
def main(
|
|
77
|
+
def main(
|
|
78
|
+
ctx: typer.Context,
|
|
79
|
+
version: bool = typer.Option(
|
|
80
|
+
False,
|
|
81
|
+
"--version",
|
|
82
|
+
"-v",
|
|
83
|
+
help="Show version and exit.",
|
|
84
|
+
),
|
|
85
|
+
) -> None:
|
|
56
86
|
"""Assertion command group."""
|
|
87
|
+
if version:
|
|
88
|
+
typer.echo(f"assertion-cli {_get_version()}")
|
|
89
|
+
raise typer.Exit()
|
|
57
90
|
if ctx.invoked_subcommand is None:
|
|
58
91
|
typer.echo(ctx.get_help())
|
|
59
92
|
raise typer.Exit(code=0)
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
api.py,sha256=AxwOMHenNpMBNMtkCg39WxDWqBpyrqGbzri4nI3fDis,7117
|
|
2
|
-
bundle.py,sha256=O616zO-SY66J0v2d1NAr3S7cshSmUIAUiYX_sI_dMYo,1515
|
|
3
|
-
git.py,sha256=nxIdwy4i9pQ-40BnFO4_sLOdQK3zUHsYG17cmXZj8uE,4010
|
|
4
|
-
link.py,sha256=bfH0MhkeTFGbOSJbSvuuw3ilGX3akyvjvCw25AP_fz8,643
|
|
5
|
-
main.py,sha256=VQW-kD93K39QSTOKDuVWGcjcT57PNCiB9c70UvKBVIU,22032
|
|
6
|
-
models.py,sha256=ApnfCO7CF5Nfdy5-ho7U-YRLWM-C3421fAT7GXa4Y30,2269
|
|
7
|
-
session.py,sha256=3oe3GbAaA2ynjk-2DFsLvwlFUMwHNnUmTKkBrQo_8IE,6507
|
|
8
|
-
assertion_cli_templates/ACTIVATION.md,sha256=3zIuHvfXA-YVIdj3Dl9fCON6vlYjr5TW3bZW6DrY5VM,2132
|
|
9
|
-
assertion_cli_templates/SKILL.md,sha256=aSo2xregb29oenhkojbLy3m9VHEqBv-v0NMZdGxhYcQ,15312
|
|
10
|
-
assertion_cli_templates/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
11
|
-
assertion_cli-0.5.2.dist-info/METADATA,sha256=R_BdCo4dblw6m-OOiAO__JtD2m27ASoahVWZ5GmrZPs,1712
|
|
12
|
-
assertion_cli-0.5.2.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
13
|
-
assertion_cli-0.5.2.dist-info/entry_points.txt,sha256=LgwuPLZEIk-4sD7ghGVRQOhm3PG8sPVozMRxrihwMgU,34
|
|
14
|
-
assertion_cli-0.5.2.dist-info/top_level.txt,sha256=xbZYH9xQOa99z-Vbkc2Xp6h8oUR97DVlyczy8H4ZuFc,64
|
|
15
|
-
assertion_cli-0.5.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|