edify-agents-cli 0.2.0__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.
- edify/__init__.py +19 -0
- edify/__main__.py +6 -0
- edify/_toml.py +286 -0
- edify/agents.py +261 -0
- edify/anim.py +499 -0
- edify/assets/commands/build.md +64 -0
- edify/assets/commands/plan.md +68 -0
- edify/assets/commands/spec.md +63 -0
- edify/assets/commands/tasks.md +65 -0
- edify/assets/commands/verify.md +67 -0
- edify/assets/formats/plan.example.md +455 -0
- edify/assets/formats/plan.format.md +128 -0
- edify/assets/formats/spec.example.md +483 -0
- edify/assets/formats/spec.format.md +116 -0
- edify/assets/formats/tasks.example.md +712 -0
- edify/assets/formats/tasks.format.md +199 -0
- edify/assets/harvest/harvest.md +91 -0
- edify/assets/harvest/sources.md +295 -0
- edify/assets/harvest/vocab.md +52 -0
- edify/assets/manifest.md +30 -0
- edify/assets/mcp/default-registry.md +66 -0
- edify/assets/skills/adversary.md +61 -0
- edify/assets/skills/debugger.md +64 -0
- edify/assets/skills/implementer-general.md +53 -0
- edify/assets/skills/implementer-go.md +63 -0
- edify/assets/skills/implementer-node.md +61 -0
- edify/assets/skills/implementer-postgres.md +63 -0
- edify/assets/skills/implementer-python.md +65 -0
- edify/assets/skills/implementer-react.md +65 -0
- edify/assets/skills/planner.md +58 -0
- edify/assets/skills/test-writer-node.md +64 -0
- edify/assets/skills/test-writer-python.md +60 -0
- edify/assets/skills/verifier.md +67 -0
- edify/assets/templates/CLAUDE.md +18 -0
- edify/assets.py +77 -0
- edify/cli.py +681 -0
- edify/commands/__init__.py +1 -0
- edify/commands/check_cmd.py +72 -0
- edify/commands/doctor_cmd.py +206 -0
- edify/commands/feedback_cmd.py +90 -0
- edify/commands/governance_cmd.py +65 -0
- edify/commands/graph_cmd.py +156 -0
- edify/commands/harvest_cmd.py +538 -0
- edify/commands/init_cmd.py +333 -0
- edify/commands/init_new_cmd.py +151 -0
- edify/commands/license_cmd.py +80 -0
- edify/commands/mcp_cmd.py +159 -0
- edify/commands/self_cmd.py +185 -0
- edify/commands/setup_cmd.py +79 -0
- edify/commands/skills_cmd.py +177 -0
- edify/commands/upgrade_cmd.py +178 -0
- edify/context.py +57 -0
- edify/conventions.py +275 -0
- edify/detect.py +313 -0
- edify/distribution.py +40 -0
- edify/errors.py +66 -0
- edify/feedback.py +207 -0
- edify/formats/__init__.py +11 -0
- edify/formats/check.py +573 -0
- edify/formats/document.py +238 -0
- edify/formats/finding.py +50 -0
- edify/formats/fix.py +114 -0
- edify/formats/mcp.py +126 -0
- edify/formats/plan.py +151 -0
- edify/formats/skill.py +139 -0
- edify/formats/spec.py +164 -0
- edify/formats/tasks.py +321 -0
- edify/governance.py +316 -0
- edify/graph/__init__.py +11 -0
- edify/graph/extract.py +351 -0
- edify/graph/ignore.py +107 -0
- edify/graph/langs/__init__.py +93 -0
- edify/graph/langs/ctags.py +145 -0
- edify/graph/langs/markdown.py +41 -0
- edify/graph/langs/patterns.py +361 -0
- edify/graph/langs/python_ast.py +154 -0
- edify/graph/langs/sqlish.py +86 -0
- edify/graph/model.py +102 -0
- edify/graph/queries.py +211 -0
- edify/graph/store.py +157 -0
- edify/harvest/__init__.py +28 -0
- edify/harvest/ledger.py +191 -0
- edify/harvest/screen.py +236 -0
- edify/harvest/sources.py +298 -0
- edify/host.py +345 -0
- edify/interview.py +354 -0
- edify/library.py +176 -0
- edify/licensing/__init__.py +30 -0
- edify/licensing/ed25519.py +154 -0
- edify/licensing/projects.py +223 -0
- edify/licensing/tier.py +172 -0
- edify/licensing/token.py +149 -0
- edify/paths.py +282 -0
- edify/selfinstall.py +244 -0
- edify/skills.py +108 -0
- edify/tsv.py +109 -0
- edify/ui.py +334 -0
- edify_agents_cli-0.2.0.dist-info/METADATA +408 -0
- edify_agents_cli-0.2.0.dist-info/RECORD +102 -0
- edify_agents_cli-0.2.0.dist-info/WHEEL +4 -0
- edify_agents_cli-0.2.0.dist-info/entry_points.txt +2 -0
- edify_agents_cli-0.2.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-writer-node
|
|
3
|
+
description: Turns spec assertions into failing tests in a TypeScript or JavaScript codebase.
|
|
4
|
+
kind: skill
|
|
5
|
+
role: test
|
|
6
|
+
phase: 2
|
|
7
|
+
tech: typescript javascript jest vitest react
|
|
8
|
+
provenance: original
|
|
9
|
+
license: -
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Test writer — Node / TypeScript
|
|
13
|
+
|
|
14
|
+
## What you're doing
|
|
15
|
+
|
|
16
|
+
Phase 2. Every assertion in the spec becomes an executable test that **fails**, at
|
|
17
|
+
the verification kind the spec declared, before any implementing code exists.
|
|
18
|
+
|
|
19
|
+
The suite you write is the definition of finished. Everything after this phase is
|
|
20
|
+
measured by how much of your red turns green, which is what lets a cheap model
|
|
21
|
+
build reliably: it is not judging its own work, it is hitting a target.
|
|
22
|
+
|
|
23
|
+
## How the work goes
|
|
24
|
+
|
|
25
|
+
1. Read the task block. It names the assertion ids you cover and the kind for each.
|
|
26
|
+
2. Open the pattern pointer and copy the fixture setup exactly — the factory
|
|
27
|
+
helpers, the teardown, the auth fixture. Every test in this repository uses it
|
|
28
|
+
and yours should be indistinguishable.
|
|
29
|
+
3. One `describe` per requirement, one `it` per assertion, and **the assertion id in
|
|
30
|
+
the test name**, so a failure output names what is unsatisfied.
|
|
31
|
+
4. Write against the contract frozen in phase 1. Import its types and schemas; never
|
|
32
|
+
redeclare a shape.
|
|
33
|
+
5. For an assertion marked `property`, write a generated-input test with the stated
|
|
34
|
+
invariant and the shrink configuration the neighbouring property test uses. Do
|
|
35
|
+
not downgrade it to three examples — the spec chose `property` because the rule
|
|
36
|
+
holds over all inputs, not over three of them.
|
|
37
|
+
6. For an assertion marked `observation`, write no test. Add a skipped placeholder
|
|
38
|
+
named for the phase-7 task that discharges it, so the assertion count stays
|
|
39
|
+
honest.
|
|
40
|
+
7. Do not stub the implementation to make anything pass. The imports resolve to
|
|
41
|
+
modules that do not exist yet; that is the expected failure at this phase.
|
|
42
|
+
8. Run the suite and confirm the count: N failing, 0 passing. Then run the type
|
|
43
|
+
check — the tests must compile against the frozen contract even while failing.
|
|
44
|
+
|
|
45
|
+
## The traps specific to this phase
|
|
46
|
+
|
|
47
|
+
- A test that passes on arrival tested something that already existed, or tested
|
|
48
|
+
nothing. Both are worth catching now.
|
|
49
|
+
- A snapshot test written before the code snapshots nothing and goes green later
|
|
50
|
+
against whatever was built. Assert values, not snapshots.
|
|
51
|
+
- An assertion on a subset of an unauthenticated response body will not catch a
|
|
52
|
+
leak. Assert the exact key set.
|
|
53
|
+
- Mocking the thing under test makes the suite agree with itself.
|
|
54
|
+
|
|
55
|
+
## When you're stuck
|
|
56
|
+
|
|
57
|
+
If an assertion cannot be written as a failing test, that is a real finding about
|
|
58
|
+
the spec, not a formatting problem. Write `BLOCKED T-n: A-k cannot fail as written
|
|
59
|
+
— <why>` and stop.
|
|
60
|
+
|
|
61
|
+
## What you hand back
|
|
62
|
+
|
|
63
|
+
The task id, the test files you wrote, the raw suite output showing the failing
|
|
64
|
+
count, and `done` or `blocked: <reason>`.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-writer-python
|
|
3
|
+
description: Turns spec assertions into failing tests in a Python codebase.
|
|
4
|
+
kind: skill
|
|
5
|
+
role: test
|
|
6
|
+
phase: 2
|
|
7
|
+
tech: python pytest django flask fastapi
|
|
8
|
+
provenance: original
|
|
9
|
+
license: -
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Test writer — Python
|
|
13
|
+
|
|
14
|
+
## What you're doing
|
|
15
|
+
|
|
16
|
+
Phase 2. Every assertion in the spec becomes an executable test that **fails**, at
|
|
17
|
+
the verification kind the spec declared, before any implementing code exists.
|
|
18
|
+
|
|
19
|
+
The suite you write is the definition of finished. Everything after this phase is
|
|
20
|
+
measured by how much of your red turns green.
|
|
21
|
+
|
|
22
|
+
## How the work goes
|
|
23
|
+
|
|
24
|
+
1. Read the task block. It names the assertion ids you cover and the kind for each.
|
|
25
|
+
2. Open the pattern pointer and copy the fixture setup exactly — the `conftest.py`
|
|
26
|
+
fixtures, the database teardown, the client fixture. Yours should be
|
|
27
|
+
indistinguishable from the tests already there.
|
|
28
|
+
3. One class or module per requirement, one test function per assertion, and **the
|
|
29
|
+
assertion id in the test name**, so a failure output names what is unsatisfied.
|
|
30
|
+
4. Write against the contract frozen in phase 1. Import its models and schemas;
|
|
31
|
+
never redeclare a shape.
|
|
32
|
+
5. For an assertion marked `property`, use the repository's property-testing library
|
|
33
|
+
with a stated invariant and a bounded example count. If the repository has none,
|
|
34
|
+
the plan should have budgeted one — say so rather than writing three examples and
|
|
35
|
+
calling it a property test.
|
|
36
|
+
6. For an assertion marked `observation`, write no test. Add a skipped placeholder
|
|
37
|
+
naming the phase-7 task that discharges it, so the assertion count stays honest.
|
|
38
|
+
7. Do not stub the implementation to make anything pass. The imports resolve to
|
|
39
|
+
modules that do not exist yet; that is the expected failure at this phase.
|
|
40
|
+
8. Run the suite and confirm the count: N failing, 0 passing.
|
|
41
|
+
|
|
42
|
+
## The traps specific to this phase
|
|
43
|
+
|
|
44
|
+
- A test that passes on arrival tested something that already existed, or nothing.
|
|
45
|
+
- `pytest.raises` with no `match=` passes on the wrong exception message.
|
|
46
|
+
- A fixture with module scope that mutates shared state makes tests pass in one
|
|
47
|
+
order and fail in another.
|
|
48
|
+
- Freezing time in one test and not the neighbouring one produces a suite that
|
|
49
|
+
fails at midnight.
|
|
50
|
+
- Mocking the thing under test makes the suite agree with itself.
|
|
51
|
+
|
|
52
|
+
## When you're stuck
|
|
53
|
+
|
|
54
|
+
If an assertion cannot be written as a failing test, that is a finding about the
|
|
55
|
+
spec. Write `BLOCKED T-n: A-k cannot fail as written — <why>` and stop.
|
|
56
|
+
|
|
57
|
+
## What you hand back
|
|
58
|
+
|
|
59
|
+
The task id, the test files you wrote, the raw suite output showing the failing
|
|
60
|
+
count, and `done` or `blocked: <reason>`.
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: verifier
|
|
3
|
+
description: Re-runs everything and writes the evidence, in a session that wrote no code.
|
|
4
|
+
kind: skill
|
|
5
|
+
role: verifier
|
|
6
|
+
phase: 7
|
|
7
|
+
tech: any
|
|
8
|
+
provenance: original
|
|
9
|
+
license: -
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Verifier
|
|
13
|
+
|
|
14
|
+
## What you're doing
|
|
15
|
+
|
|
16
|
+
Producing `verification.md`: what was run, what came out, and what that means for
|
|
17
|
+
every row of the coverage table. You wrote none of this code and you will not edit
|
|
18
|
+
any of it.
|
|
19
|
+
|
|
20
|
+
You run things. You do not decide things. Every number in your report is one you
|
|
21
|
+
produced by running a command, not one you were told.
|
|
22
|
+
|
|
23
|
+
## How the work goes
|
|
24
|
+
|
|
25
|
+
1. **Re-run everything.** The full suite, the type check, the lint, invoked exactly
|
|
26
|
+
as the spec's constraints say to invoke them. Paste the raw output. A summary of
|
|
27
|
+
a test run is a claim about a test run, and the reason this runs in a fresh
|
|
28
|
+
session is that claims about one's own work carry no information.
|
|
29
|
+
2. **Confirm the ordering.** `git log --stat` on the assertion tests and the source
|
|
30
|
+
files they exercise. Every test file must land before the code it tests. A suite
|
|
31
|
+
written afterwards encodes the behaviour the code has rather than the behaviour
|
|
32
|
+
the spec asked for, and this is the only mechanical way to tell which happened.
|
|
33
|
+
3. **Exercise it for real.** Start the service and make real calls, drive the
|
|
34
|
+
interface, run the job against fixtures. Paste the transcript. This is where the
|
|
35
|
+
class of failure that passes every unit test surfaces.
|
|
36
|
+
4. **Walk the coverage table**, row by row. Each is satisfied with its evidence,
|
|
37
|
+
waived with its reason, or blocked with what is missing. Check each assertion
|
|
38
|
+
against the verification kind the spec declared: a property test that became an
|
|
39
|
+
example test is a silent downgrade and is reported, not accepted.
|
|
40
|
+
5. **Check the plan's milestone gates**, if there is a plan. They are separate from
|
|
41
|
+
the spec's assertions and nothing else checks them.
|
|
42
|
+
6. **Read the whole diff as one design.** The one judgment call: is there one way of
|
|
43
|
+
doing each thing here, or several? Name specifics — a second helper duplicating
|
|
44
|
+
an existing one, two error-handling styles, inconsistent vocabulary between
|
|
45
|
+
modules. `edify graph where <name>` finds the duplicate you suspect.
|
|
46
|
+
|
|
47
|
+
## The traps
|
|
48
|
+
|
|
49
|
+
- Accepting a reported result. If you did not run it, it did not happen.
|
|
50
|
+
- Summarising output. The raw text is the evidence; your summary is a claim.
|
|
51
|
+
- Marking an `observation` row satisfied without the attached transcript, screen
|
|
52
|
+
capture, or recording. "I checked and it works" is not an observation.
|
|
53
|
+
- Writing "no duplication found" without saying what you checked for.
|
|
54
|
+
- Fixing something. If you find a defect, it is a finding. Editing code in this
|
|
55
|
+
session destroys the independence that makes the report worth reading.
|
|
56
|
+
|
|
57
|
+
## When you're stuck
|
|
58
|
+
|
|
59
|
+
If a command cannot be run here — no database, no device, no network — say that,
|
|
60
|
+
name the row it leaves unverified, and mark it blocked. An unverifiable row that is
|
|
61
|
+
honestly blocked is worth more than one quietly marked satisfied.
|
|
62
|
+
|
|
63
|
+
## What you hand back
|
|
64
|
+
|
|
65
|
+
`verification.md` with its four sections — `## Ran`, `## Ordering`, `## Coverage`,
|
|
66
|
+
`## One design` — and one line saying how many coverage rows are satisfied, waived,
|
|
67
|
+
and blocked.
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# {{repo}}
|
|
2
|
+
Stack: {{stack}} · Tests: {{test}}
|
|
3
|
+
|
|
4
|
+
## Commands
|
|
5
|
+
/spec — write the spec before anything else
|
|
6
|
+
/plan — technology decisions and milestones, for work that needs them
|
|
7
|
+
/tasks — turn an approved spec into the phased build plan
|
|
8
|
+
/build — execute an approved plan, start to finish
|
|
9
|
+
/verify — re-run everything and produce the evidence
|
|
10
|
+
|
|
11
|
+
## The codebase map
|
|
12
|
+
.edify/graph/ — every symbol, route, and table, with the edges between them.
|
|
13
|
+
edify graph where <name> → file:line and signature
|
|
14
|
+
edify graph dependents <symbol> → everything that breaks if it changes
|
|
15
|
+
Search the graph before reading files. Never guess a path.
|
|
16
|
+
|
|
17
|
+
## Where things live
|
|
18
|
+
Features: specs/<feature>/ Skills: .edify/skills/ Servers: .edify/mcp.md
|
edify/assets.py
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"""Finding the shipped methodology tree.
|
|
2
|
+
|
|
3
|
+
The authored tree lives at the repository root in `edify/` (the source tree the
|
|
4
|
+
installed layout is built from) and is copied into the wheel at
|
|
5
|
+
`edify/assets/`. Both layouts resolve here, so a developer running from a checkout
|
|
6
|
+
and a user running an installed wheel get the same files.
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
from __future__ import annotations
|
|
10
|
+
|
|
11
|
+
import os
|
|
12
|
+
from functools import lru_cache
|
|
13
|
+
from pathlib import Path
|
|
14
|
+
|
|
15
|
+
from .distribution import DIST_NAME
|
|
16
|
+
from .errors import EdifyError
|
|
17
|
+
|
|
18
|
+
_SUBTREES = ("commands", "formats", "skills", "mcp", "harvest", "templates")
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
@lru_cache(maxsize=1)
|
|
22
|
+
def asset_root() -> Path:
|
|
23
|
+
"""The directory holding manifest.md, commands/, formats/, skills/, mcp/, harvest/."""
|
|
24
|
+
override = os.environ.get("EDIFY_ASSETS")
|
|
25
|
+
if override:
|
|
26
|
+
p = Path(override).expanduser().resolve()
|
|
27
|
+
if _looks_like_assets(p):
|
|
28
|
+
return p
|
|
29
|
+
raise EdifyError(f"EDIFY_ASSETS points at {p}, which has no commands/ or skills/")
|
|
30
|
+
|
|
31
|
+
# Installed wheel: src/edify/assets/
|
|
32
|
+
packaged = Path(__file__).resolve().parent / "assets"
|
|
33
|
+
if _looks_like_assets(packaged):
|
|
34
|
+
return packaged
|
|
35
|
+
|
|
36
|
+
# Developer checkout: <repo>/edify/
|
|
37
|
+
for parent in Path(__file__).resolve().parents:
|
|
38
|
+
candidate = parent / "edify"
|
|
39
|
+
if candidate != packaged and _looks_like_assets(candidate):
|
|
40
|
+
return candidate
|
|
41
|
+
|
|
42
|
+
raise EdifyError(
|
|
43
|
+
"the methodology tree is missing from this install",
|
|
44
|
+
hint=f"reinstall {DIST_NAME}, or set EDIFY_ASSETS to a checkout's edify/ directory",
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
def _looks_like_assets(path: Path) -> bool:
|
|
49
|
+
return path.is_dir() and (path / "commands").is_dir() and (path / "skills").is_dir()
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
def subtree(name: str) -> Path:
|
|
53
|
+
if name not in _SUBTREES:
|
|
54
|
+
raise EdifyError(f"unknown asset subtree: {name}")
|
|
55
|
+
return asset_root() / name
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def read(*parts: str) -> str:
|
|
59
|
+
path = asset_root().joinpath(*parts)
|
|
60
|
+
if not path.is_file():
|
|
61
|
+
raise EdifyError(f"missing shipped asset: {'/'.join(parts)}")
|
|
62
|
+
return path.read_text(encoding="utf-8")
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def manifest() -> dict[str, str]:
|
|
66
|
+
"""The pinned versions and checksums the install declares. Flat key: value."""
|
|
67
|
+
out: dict[str, str] = {}
|
|
68
|
+
path = asset_root() / "manifest.md"
|
|
69
|
+
if not path.is_file():
|
|
70
|
+
return out
|
|
71
|
+
for line in path.read_text(encoding="utf-8").splitlines():
|
|
72
|
+
line = line.strip()
|
|
73
|
+
if not line.startswith("- ") or ":" not in line:
|
|
74
|
+
continue
|
|
75
|
+
key, _, value = line[2:].partition(":")
|
|
76
|
+
out[key.strip().strip("`*")] = value.strip().strip("`")
|
|
77
|
+
return out
|