lardva 2.0.1__tar.gz
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.
- lardva-2.0.1/.gitattributes +1 -0
- lardva-2.0.1/.gitignore +2 -0
- lardva-2.0.1/CHANGELOG.md +53 -0
- lardva-2.0.1/LICENSE +21 -0
- lardva-2.0.1/PKG-INFO +304 -0
- lardva-2.0.1/README.md +294 -0
- lardva-2.0.1/install.py +34 -0
- lardva-2.0.1/payload/.agents/POLICY.md +9 -0
- lardva-2.0.1/payload/.agents/PROJECT.md +16 -0
- lardva-2.0.1/payload/.agents/providers.md +23 -0
- lardva-2.0.1/payload/.agents/schemas/findings.schema.json +93 -0
- lardva-2.0.1/payload/.agents/schemas/rulings.schema.json +54 -0
- lardva-2.0.1/payload/.agents/scripts/context.py +1115 -0
- lardva-2.0.1/payload/.agents/scripts/evidence.py +183 -0
- lardva-2.0.1/payload/.agents/scripts/test_context.py +1279 -0
- lardva-2.0.1/payload/.agents/scripts/test_evidence.py +73 -0
- lardva-2.0.1/payload/.agents/skills/agent-orchestrator/SKILL.md +26 -0
- lardva-2.0.1/payload/.agents/skills/agent-system-design/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/context-engineering/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/context-refresh/SKILL.md +19 -0
- lardva-2.0.1/payload/.agents/skills/context-sync/SKILL.md +24 -0
- lardva-2.0.1/payload/.agents/skills/docs-traceability/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/epic-delivery/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/evidence-review/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/investigate-first/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/lean-build/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/migration/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/performance-baseline/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/research-experiment/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/retrieval-evaluation/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/safe-refactor/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/security-review/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/session-handoff/SKILL.md +22 -0
- lardva-2.0.1/payload/.agents/skills/spec-driven-design/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/spec-reconciliation/SKILL.md +33 -0
- lardva-2.0.1/payload/.agents/skills/surgical-patch/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/skills/verify-and-stop/SKILL.md +8 -0
- lardva-2.0.1/payload/.agents/templates/ADR.md +6 -0
- lardva-2.0.1/payload/.agents/templates/SAD.md +7 -0
- lardva-2.0.1/payload/.agents/templates/SDD.md +7 -0
- lardva-2.0.1/payload/.agents/templates/SRS.md +10 -0
- lardva-2.0.1/payload/.agents/templates/TASKS.md +4 -0
- lardva-2.0.1/payload/.agents/templates/brief.md +10 -0
- lardva-2.0.1/payload/.agents/templates/handoff.json +21 -0
- lardva-2.0.1/payload/.agents/templates/handoff.md +7 -0
- lardva-2.0.1/payload/.agents/templates/prompts.md +19 -0
- lardva-2.0.1/payload/.agents/templates/telemetry.json +26 -0
- lardva-2.0.1/payload/.claude/agents/builder.md +8 -0
- lardva-2.0.1/payload/.claude/agents/reviewer.md +8 -0
- lardva-2.0.1/payload/.claude/agents/scout.md +8 -0
- lardva-2.0.1/payload/.claude/skills/agent-orchestrator/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/agent-system-design/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/context-engineering/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/context-refresh/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/context-sync/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/docs-traceability/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/epic-delivery/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/evidence-review/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/investigate-first/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/lean-build/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/migration/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/performance-baseline/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/research-experiment/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/retrieval-evaluation/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/safe-refactor/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/security-review/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/session-handoff/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/spec-driven-design/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/spec-reconciliation/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/surgical-patch/SKILL.md +6 -0
- lardva-2.0.1/payload/.claude/skills/verify-and-stop/SKILL.md +6 -0
- lardva-2.0.1/payload/.codex/agents/builder.toml +6 -0
- lardva-2.0.1/payload/.codex/agents/reviewer.toml +7 -0
- lardva-2.0.1/payload/.codex/agents/scout.toml +7 -0
- lardva-2.0.1/payload/AGENTS.md +30 -0
- lardva-2.0.1/payload/CLAUDE.md +2 -0
- lardva-2.0.1/pyproject.toml +31 -0
- lardva-2.0.1/scripts/gen_history.py +72 -0
- lardva-2.0.1/scripts/smoke_wheel.py +93 -0
- lardva-2.0.1/src/lardva/__init__.py +2 -0
- lardva-2.0.1/src/lardva/__main__.py +3 -0
- lardva-2.0.1/src/lardva/cli.py +314 -0
- lardva-2.0.1/src/lardva/doctor.py +68 -0
- lardva-2.0.1/src/lardva/engine.py +931 -0
- lardva-2.0.1/src/lardva/history.json +349 -0
- lardva-2.0.1/tests/kill_at.py +43 -0
- lardva-2.0.1/tests/lardva_helpers.py +124 -0
- lardva-2.0.1/tests/test_confirm.py +101 -0
- lardva-2.0.1/tests/test_doctor.py +130 -0
- lardva-2.0.1/tests/test_faults.py +174 -0
- lardva-2.0.1/tests/test_final_hypotheses.py +91 -0
- lardva-2.0.1/tests/test_init.py +148 -0
- lardva-2.0.1/tests/test_install.py +107 -0
- lardva-2.0.1/tests/test_packaging.py +80 -0
- lardva-2.0.1/tests/test_paths.py +104 -0
- lardva-2.0.1/tests/test_record.py +98 -0
- lardva-2.0.1/tests/test_recover.py +156 -0
- lardva-2.0.1/tests/test_review_cr1.py +171 -0
- lardva-2.0.1/tests/test_update.py +138 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
payload/** text eol=lf
|
lardva-2.0.1/.gitignore
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are recorded here. `2.0.0` is the first packaged release.
|
|
4
|
+
|
|
5
|
+
## [2.0.1] - 2026-12-06
|
|
6
|
+
|
|
7
|
+
Documentation and packaging only; the payload, skills and CLI behavior are unchanged from 2.0.0. The first version intended for PyPI.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
- Manual `publish` workflow: builds an existing release tag after checking its commit, version and history snapshot, smoke-tests the wheel, and uploads the verified files to TestPyPI or PyPI with Trusted Publishing. The TestPyPI path builds with a pinned build backend; the PyPI path promotes the exact files from TestPyPI instead of rebuilding. Not yet run.
|
|
11
|
+
- `docs/GETTING-STARTED.md` (existing repositories, adoption, safe updates, troubleshooting) and `docs/PHASE4-RELEASE-PLAN.md`.
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
- README: CI, release and license badges; link to the getting-started guide. For the PyPI project page: absolute logo and links, the diagram as plain text, and the "not published to PyPI" sentence removed.
|
|
15
|
+
|
|
16
|
+
## [2.0.0] - 2026-12-05
|
|
17
|
+
|
|
18
|
+
### Breaking
|
|
19
|
+
- New install lifecycle: the `lardva` command (`init`, `update`, `uninstall`, `status`, `doctor`, `recover`) and a committed install record `.agents/lardva.json`. Projects installed with `install.py` have no record; run `lardva init --adopt` once to manage them with the CLI.
|
|
20
|
+
- Destructive `update` and `uninstall` on a record that is not confirmed on this machine (a fresh clone, or a record changed by a pull) stop and ask for `--trust-record <code>`.
|
|
21
|
+
- `update` treats any modified Lardva file as a conflict, including one whose content already equals the new release.
|
|
22
|
+
- No rollback of completed operations. Uninstall keeps the `.gitignore` line and empty directories.
|
|
23
|
+
- `context.py stamp` now requires `--capture` from the new `context.py capture` command, taken before generation.
|
|
24
|
+
- `context.py check` exits 1 when a standard artifact is missing from the manifest; use `--allow-partial` for scoped manifests.
|
|
25
|
+
- `handoff-check` enforces the full handoff contract and reports pass results as per-claim `claims` instead of `recorded_pass_claims`; verification entries use `gate_fingerprint`.
|
|
26
|
+
- `discover` no longer infers `hybrid`; it adds `needs_confirmation`, `alternatives` and `evidence` to `mode_signal`.
|
|
27
|
+
- User-owned artifacts such as `.agents/PROJECT.md` now count as sources of the other artifacts, and `init` seeds PROJECT.md into every generated artifact's inputs. A full sync must stamp PROJECT.md before capturing the generated artifacts. Manifests stamped by earlier builds report the whole-repository artifacts stale once (PROJECT.md appears as a new source); regenerate and restamp them.
|
|
28
|
+
- `handoff-check` rejects approved scope entries that are excluded from fingerprinting.
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
- Context freshness: whole-repository defaults for code-dependent artifacts and detection of new relevant files outside targeted inputs.
|
|
32
|
+
- Context generated from one source version can no longer be stamped against another; concurrent stamps cannot lose updates.
|
|
33
|
+
- `evidence.py` rejects Windows junctions, which could expose excluded directories such as `.git`.
|
|
34
|
+
- `test_symlink` skips explicitly only when the platform denies symlink creation; junction and mock tests keep the assertion covered.
|
|
35
|
+
- Capture records each artifact's prior bytes; stamp refuses artifacts not regenerated after capture. Unreadable directories are reported, legacy narrow inputs require review, excluded VCS/secret paths match in any case, contradictory verification records and uncovered handoff scopes are rejected. Stamp refuses restored older output, requires `--accept-uncovered` for deliberate input exclusions, and does not require user-owned artifacts to be rewritten; editing inputs reports `inputs_changed` instead of an invalid manifest; manifest paths spelled differently from the file system are refused.
|
|
36
|
+
- Edits to user-owned PROJECT.md policy now invalidate dependent context artifacts; a handoff can no longer approve scope that is never fingerprinted.
|
|
37
|
+
|
|
38
|
+
### Changed
|
|
39
|
+
- Rebranded the project from HydraHarness to **Lardva**: README, installer output and help, installed `AGENTS.md` title, and the logo. The intended repository URL is `https://github.com/thuan-NM/lardva`. Skill names, file paths, schemas and utility interfaces are unchanged, so existing installations keep working.
|
|
40
|
+
- The installer now explains `--apply` and the `project` argument in `--help`, and prefixes console output with `Lardva:`.
|
|
41
|
+
|
|
42
|
+
### Added
|
|
43
|
+
- Python packaging (`pyproject.toml`, hatchling) with the payload bundled in the wheel; install with `uv tool install git+https://github.com/thuan-NM/Lardva.git@v2.0.0` or `pipx install ...`.
|
|
44
|
+
- `lardva` CLI with ownership tracking, conflict reports, per-machine confirmation, interruption recovery, `--dry-run` and `--json`.
|
|
45
|
+
- MIT `LICENSE`; `.gitattributes` keeps payload files LF.
|
|
46
|
+
- CI on Ubuntu, Windows and macOS with a packaging job that installs the built wheel with uv and pipx.
|
|
47
|
+
- Project context management: the `context-sync`, `context-refresh`, `spec-reconciliation` and `session-handoff` skills (21 skills in total) and the deterministic `.agents/scripts/context.py` utility.
|
|
48
|
+
- `CONTRIBUTING.md`, `SECURITY.md`, a pull request template and a GitHub Actions test workflow.
|
|
49
|
+
|
|
50
|
+
## [1.0] - 2026-12-01
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
- Initial skill pack, published as **HydraHarness**: 17 skills, Claude Code and Codex adapters, `evidence.py` validator, templates and installer.
|
lardva-2.0.1/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 thuan-NM
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
lardva-2.0.1/PKG-INFO
ADDED
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: lardva
|
|
3
|
+
Version: 2.0.1
|
|
4
|
+
Summary: Portable, provider-neutral engineering kit for AI coding agents
|
|
5
|
+
Project-URL: Repository, https://github.com/thuan-NM/Lardva
|
|
6
|
+
License-Expression: MIT
|
|
7
|
+
License-File: LICENSE
|
|
8
|
+
Requires-Python: >=3.11
|
|
9
|
+
Description-Content-Type: text/markdown
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<img src="https://raw.githubusercontent.com/thuan-NM/Lardva/v2.0.0/assets/lardva-logo.svg" alt="Lardva caterpillar logo" width="200">
|
|
13
|
+
</p>
|
|
14
|
+
|
|
15
|
+
<h1 align="center">Lardva</h1>
|
|
16
|
+
|
|
17
|
+
<p align="center"><strong>Engineer with intent. Execute with evidence.</strong></p>
|
|
18
|
+
|
|
19
|
+
<p align="center">A portable, spec-driven engineering harness for AI coding agents.</p>
|
|
20
|
+
|
|
21
|
+
<p align="center">
|
|
22
|
+
<a href="https://github.com/thuan-NM/Lardva/actions/workflows/test.yml"><img src="https://github.com/thuan-NM/Lardva/actions/workflows/test.yml/badge.svg?branch=main" alt="test"></a>
|
|
23
|
+
<a href="https://github.com/thuan-NM/Lardva/releases/latest"><img src="https://img.shields.io/github/v/release/thuan-NM/Lardva" alt="release"></a>
|
|
24
|
+
<a href="https://github.com/thuan-NM/Lardva/blob/main/LICENSE"><img src="https://img.shields.io/github/license/thuan-NM/Lardva" alt="license: MIT"></a>
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
Lardva is a set of shared engineering skills, agent instructions and small local verification utilities that you install into a repository. It helps you structure, guide and verify AI-assisted software engineering in greenfield, brownfield and spec-driven projects, with Claude Code and Codex as the documented providers.
|
|
30
|
+
|
|
31
|
+
Lardva is an **instruction harness with deterministic local checks**. It is not an autonomous runtime orchestrator, scheduler, policy-enforcement engine or ML router.
|
|
32
|
+
|
|
33
|
+
## Why Lardva exists
|
|
34
|
+
|
|
35
|
+
Coding agents are fast but forget context, overbuild, and report "done" without proof. Lardva gives every agent session the same contract: read the project's context and specifications first, choose a risk-appropriate workflow, make the smallest complete change, and back every claim with source citations and actual test results. Independent cross-provider review is built into the workflow for risky changes.
|
|
36
|
+
|
|
37
|
+
Principles: context-aware, spec-driven, evidence-driven, provider-agnostic by design.
|
|
38
|
+
|
|
39
|
+
## Core capabilities
|
|
40
|
+
|
|
41
|
+
| Capability | What it is | Kind |
|
|
42
|
+
|---|---|---|
|
|
43
|
+
| Engineering contract | `AGENTS.md` non-negotiables, risk routing (L0 solo / L1 lean / L2 cross-review), definition of done | instruction |
|
|
44
|
+
| 21 skills | spec-driven design, delivery loops, debugging, refactoring, migration, security, review, context management | instruction |
|
|
45
|
+
| Role agents | read-only `scout` and `reviewer`, scoped `builder` for Claude Code and Codex | provider adapter |
|
|
46
|
+
| Evidence validator | `evidence.py`: SHA-256 snapshots, exact-line citation checks, findings/rulings schema validation | deterministic utility |
|
|
47
|
+
| Context utility | `context.py`: repository discovery, fingerprints, context freshness, affected-artifact mapping, handoff staleness | deterministic utility |
|
|
48
|
+
| Templates | SRS, SAD, SDD, ADR, tasks, briefs, handoffs, telemetry, prompts | documents |
|
|
49
|
+
| `lardva` CLI | `init`, `update`, `uninstall`, `status`, `doctor`, `recover`: ownership-tracked lifecycle with conflict reports and interruption recovery | deterministic utility |
|
|
50
|
+
| Legacy installer | `install.py`: dry-run by default, never overwrites, no dependencies | deterministic utility |
|
|
51
|
+
|
|
52
|
+
Instruction-level guidance shapes what the model is asked to do; it does not guarantee compliance. Only the Python utilities, the `lardva` CLI and the installer behave deterministically.
|
|
53
|
+
|
|
54
|
+
## How it works
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
lardva init (or install.py) --copies payload, never overwrites--> your repository
|
|
58
|
+
AGENTS.md / CLAUDE.md --> .agents/skills/*
|
|
59
|
+
.agents/scripts/context.py --> .agents/context/ (project context + manifest)
|
|
60
|
+
--> .agent-runs/ (snapshots, handoffs; git-ignored)
|
|
61
|
+
.agents/scripts/evidence.py --> .agent-runs/
|
|
62
|
+
optional, authorized: guest provider review (Claude Code / Codex)
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
1. The agent reads `AGENTS.md`, `.agents/PROJECT.md` and the skill that matches the task.
|
|
66
|
+
2. `context-sync` builds evidence-tagged project context; `context.py` records what it was derived from.
|
|
67
|
+
3. Work follows a skill (for example `lean-build`, `surgical-patch`, `epic-delivery`) at a risk level chosen by `agent-orchestrator`.
|
|
68
|
+
4. Reviews cite exact source lines; `evidence.py` validates the citations against a frozen snapshot.
|
|
69
|
+
5. `session-handoff` persists state so another session or provider can resume after `context.py handoff-check`.
|
|
70
|
+
|
|
71
|
+
## Quick start
|
|
72
|
+
|
|
73
|
+
Requires Python 3.11+ and [uv](https://docs.astral.sh/uv/) or [pipx](https://pipx.pypa.io/). Use `python` instead of `python3` on Windows.
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
uv tool install git+https://github.com/thuan-NM/Lardva.git@v2.0.1 # or: pipx install git+https://github.com/thuan-NM/Lardva.git@v2.0.1
|
|
77
|
+
cd /path/to/your-project
|
|
78
|
+
lardva init --dry-run # shows what would be written; writes nothing
|
|
79
|
+
lardva init
|
|
80
|
+
lardva doctor
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Pin a tag (`@vX.Y.Z`) or a commit for reproducible installs. [Getting started](https://github.com/thuan-NM/Lardva/blob/main/docs/GETTING-STARTED.md) walks through existing repositories, adoption of `install.py` installs, safe updates, uninstall and troubleshooting. Then restart Claude Code or Codex in the project and ask:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
Read AGENTS.md. Use context-sync on this repository; do not modify source or specs; report readiness and open decisions.
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## Installation
|
|
90
|
+
|
|
91
|
+
### `lardva` CLI (recommended)
|
|
92
|
+
|
|
93
|
+
| Command | What it does |
|
|
94
|
+
|---|---|
|
|
95
|
+
| `lardva init [PATH] [--dry-run] [--adopt] [--keep PATH]` | Installs every payload file, seeds `.agents/PROJECT.md`, writes the install record `.agents/lardva.json` and appends `/.agent-runs/` to `.gitignore`. Any conflict aborts before anything is written. |
|
|
96
|
+
| `lardva status [PATH]` | Reports each recorded file as `clean`, `modified`, `missing`, `kept` or `unknown`. |
|
|
97
|
+
| `lardva update [PATH] [--dry-run] [--keep PATH] [--trust-record CODE]` | Replaces or deletes only unmodified Lardva files and adds new ones. Any conflict aborts the whole update. |
|
|
98
|
+
| `lardva uninstall [PATH] [--dry-run] [--trust-record CODE]` | Deletes unmodified Lardva files and the record; keeps everything else. |
|
|
99
|
+
| `lardva recover [PATH] [--dry-run]` | Finishes an interrupted `init`, `update` or `uninstall` conservatively. |
|
|
100
|
+
| `lardva doctor [PATH]` | Read-only diagnostics; executes nothing. |
|
|
101
|
+
|
|
102
|
+
Every command accepts `--json` and prints exactly one JSON object.
|
|
103
|
+
|
|
104
|
+
- **Ownership.** The committed record `.agents/lardva.json` lists each path as `managed` (Lardva's bytes), `user-config` (`.agents/PROJECT.md`) or `external` (kept with `--keep`). Lardva replaces or deletes a file only when it is `managed`, unmodified since Lardva wrote it, and the record is confirmed on this machine. `PROJECT.md`, kept files, `.agents/context/**` and `.agent-runs/**` are never written.
|
|
105
|
+
- **Confirmation.** A record from a clone or a pull is a claim. Before the first replace or delete on this machine, Lardva lists the actions, prints a confirmation code and asks you to re-run with `--trust-record <code>`. Adds need no confirmation. Confirmation is stored outside the project.
|
|
106
|
+
- **Conflicts.** A modified Lardva file, or an unrecorded file at a new Lardva path, stops `update`. Restore the recorded content (for example with `git checkout`), delete an unowned file, or release the path for good with `--keep PATH`.
|
|
107
|
+
- **Recovery, not rollback.** If a command is interrupted, `lardva recover` restores replaced and deleted files that it can prove it changed. It never deletes a file and never overwrites a later change; anything ambiguous, including every added file, is kept and reported with a manual step. There is no rollback of a completed operation; use git.
|
|
108
|
+
- **Existing installs.** A project installed by `install.py` has no record. Run `lardva init --adopt` once: it records files whose content matches a known Lardva release as `managed` and rewrites nothing.
|
|
109
|
+
- **Uninstall** leaves `PROJECT.md`, kept and modified files, empty directories and the `.gitignore` line in place.
|
|
110
|
+
|
|
111
|
+
Exit codes: `0` success; `1` needs attention (conflicts, confirmation required, modified/missing/unknown files, preserved recovery targets, warnings); `2` usage error, invalid record or unreadable journal; `3` record from a newer schema or a newer `lardva` (upgrade the tool); `4` another `lardva` is running, or an interrupted transaction needs `lardva recover`.
|
|
112
|
+
|
|
113
|
+
### `install.py` (from a clone, unchanged)
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
git clone https://github.com/thuan-NM/Lardva.git
|
|
117
|
+
python3 Lardva/install.py /path/to/your-project # dry run: reports what would be written
|
|
118
|
+
python3 Lardva/install.py /path/to/your-project --apply # install
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
`install.py` copies everything under `payload/` into the target directory:
|
|
122
|
+
|
|
123
|
+
- Dry run by default; `--apply` is required to write.
|
|
124
|
+
- Never overwrites a file with different content. Any conflict aborts the whole installation before anything is written; merge manually from `payload/`.
|
|
125
|
+
- Identical files are skipped, so re-running is idempotent.
|
|
126
|
+
- Refuses symlinked targets and non-directory parents.
|
|
127
|
+
- Appends `/.agent-runs/` to `.gitignore` once.
|
|
128
|
+
- Installs no dependencies, calls no provider, changes no global configuration, and writes no install record. Use `lardva init --adopt` to manage such an install with the CLI.
|
|
129
|
+
|
|
130
|
+
The target can be new (greenfield) or existing (brownfield). If you copy files by hand, include the dot-directories and the `.gitignore` line.
|
|
131
|
+
|
|
132
|
+
After installing, fill in or confirm `.agents/PROJECT.md`: provider permissions, protected tests, data classification and budget are always yours to set. Do not run unattended until budget, scope and permissions are defined.
|
|
133
|
+
|
|
134
|
+
## Usage examples
|
|
135
|
+
|
|
136
|
+
```text
|
|
137
|
+
Read AGENTS.md. Use spec-driven-design to draft SRS/SAD/SDD and epics from this brief. Stop at unresolved business decisions.
|
|
138
|
+
Implement approved epic EP-02 using epic-delivery and agent-orchestrator. I authorize read-only Codex review, local writes and the focused tests; no commit or deploy.
|
|
139
|
+
Use investigate-first on the failing checkout test, then surgical-patch with a regression test.
|
|
140
|
+
Use spec-reconciliation for FR-010..FR-030 against the current code; run the focused test commands from verification.md.
|
|
141
|
+
Use session-handoff SAVE for run 20260301-billing. / Use session-handoff RESUME from .agent-runs/20260301-billing/handoff.json.
|
|
142
|
+
Review this branch full, read-only, with Claude and Codex; validate evidence; do not edit.
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
More prompts: `payload/.agents/templates/prompts.md`.
|
|
146
|
+
|
|
147
|
+
## Skill catalog
|
|
148
|
+
|
|
149
|
+
Canonical skills live in `.agents/skills/<name>/SKILL.md`; `.claude/skills/` contains thin discovery shims that point to them.
|
|
150
|
+
|
|
151
|
+
| Area | Skill | When to use |
|
|
152
|
+
|---|---|---|
|
|
153
|
+
| Orchestration | agent-orchestrator | cross-check, adversarial review, full review, high-risk changes |
|
|
154
|
+
| | epic-delivery | bounded delivery loop for an approved epic |
|
|
155
|
+
| Specification | spec-driven-design | produce SRS, SAD, SDD, ADR and acceptance criteria |
|
|
156
|
+
| | spec-reconciliation | classify requirements vs implementation and record drift |
|
|
157
|
+
| | docs-traceability | map FR/AC to code and tests |
|
|
158
|
+
| Building | lean-build | narrowly scoped feature, complete but lean |
|
|
159
|
+
| | surgical-patch | localized bug fix with regression proof |
|
|
160
|
+
| | safe-refactor | behavior-preserving restructuring |
|
|
161
|
+
| | migration | schema, data, API or dependency transitions with rollback |
|
|
162
|
+
| Diagnosis and proof | investigate-first | root cause before editing |
|
|
163
|
+
| | verify-and-stop | verify against acceptance, then stop |
|
|
164
|
+
| | evidence-review | review with exact citations and failure scenarios |
|
|
165
|
+
| | security-review | trust boundaries, secrets, tenancy, untrusted input |
|
|
166
|
+
| | performance-baseline | before/after measurement |
|
|
167
|
+
| Context | context-engineering | minimal sufficient context and tool usage |
|
|
168
|
+
| | context-sync | discover a repository and generate `.agents/context` |
|
|
169
|
+
| | context-refresh | refresh only context whose sources changed |
|
|
170
|
+
| | session-handoff | save and resume execution state across sessions and providers |
|
|
171
|
+
| AI systems | agent-system-design | LLM and multi-agent application design |
|
|
172
|
+
| | retrieval-evaluation | RAG and knowledge-retrieval evaluation |
|
|
173
|
+
| | research-experiment | reproducible experiments, ablations, telemetry |
|
|
174
|
+
|
|
175
|
+
## Context engineering and project adaptation
|
|
176
|
+
|
|
177
|
+
Lardva adapts to a project through generated context instead of hand-edited shared skills.
|
|
178
|
+
|
|
179
|
+
| Part | Kind | Guarantees |
|
|
180
|
+
|---|---|---|
|
|
181
|
+
| `.agents/scripts/context.py` | deterministic utility (stdlib, no LLM) | SHA-256 fingerprints, freshness, changed/added/deleted/renamed sources, affected artifacts, manifest and handoff validation, JSON output, exit codes |
|
|
182
|
+
| `context-sync`, `context-refresh`, `spec-reconciliation`, `session-handoff` | instruction-based workflows | none enforced: they guide the model, which may still err; review their output |
|
|
183
|
+
|
|
184
|
+
Generated context lives in `.agents/context/` (`architecture.md`, `codebase-map.md`, `conventions.md`, `business-invariants.md`, `verification.md`, `risk-map.md`, `spec-index.md`, `spec-drift.md`, `manifest.json`) plus the user-owned `.agents/PROJECT.md`. Every material claim is tagged VERIFIED, INFERRED or UNKNOWN with its source. The manifest records, per artifact, an owner (`generated` or `user`), explicit input paths/globs, and the hashes of those inputs and of the artifact at the last stamp.
|
|
185
|
+
|
|
186
|
+
1. **Initial synchronization** (`context-sync`): `context.py discover` finds instructions, manifests, lockfiles, CI, tooling, specs and source roots and proposes a mode (INFERRED, never hybrid; it flags when confirmation is needed); the agent maps architecture, commands, invariants and risk from evidence; `context.py init` seeds the manifest (never overwrites); the agent runs `context.py capture` before reading sources and `context.py stamp --capture` after writing, so context is bound to the sources it was generated from; `context.py check` must then exit 0.
|
|
187
|
+
2. **Incremental refresh** (`context-refresh`): `context.py check` hashes current files, including uncommitted and untracked ones, and lists stale artifacts; `context.py affected --paths ...` maps a task's changed paths. Only stale artifacts are rewritten and re-stamped. `stamp` needs an explicit scope (`--artifact` or `--all`) and a capture; it refuses sources that changed after capture, artifacts whose sources changed but whose bytes did not (override with `--confirm-unchanged` after checking), and concurrent stamps (lock file). Artifacts whose owner code is unknown (`architecture`, `codebase-map`, `business-invariants`, `risk-map`, `spec-drift`) depend on the whole repository; targeted artifacts are also marked stale when new specs, manifests, CI, tooling or instruction files appear outside their inputs. `fresh` means all standard artifacts are present and their source fingerprints match; artifact content is never verified. Unknown impact falls back to full sync.
|
|
188
|
+
3. **Specification reconciliation** (`spec-reconciliation`): classifies each FR/NFR/AC/ADR/epic/invariant as IMPLEMENTED, PARTIAL, MISSING, DEVIATES, UNVERIFIED or NOT_APPLICABLE into `spec-drift.md`, keeping intended and observed behavior separate. It never edits specs or code.
|
|
189
|
+
4. **Session handoff and resume** (`session-handoff`): SAVE writes `.agent-runs/<run-id>/handoff.json` (template `.agents/templates/handoff.json`) embedding `context.py fingerprint`; RESUME runs `context.py handoff-check`, which rejects other repositories, corrupted or edited fingerprints (a checksum, not a signature) and credential-like content, validates the execution-state contract (scope, requirements, tasks, findings, verification, budget, next action), and reports HEAD, worktree (including staged index content), scoped-source and context changes. Repository freshness (`current`) is reported separately from each pass claim, which is `supported` only while its evidence log and gate inputs are unchanged.
|
|
190
|
+
|
|
191
|
+
```bash
|
|
192
|
+
python3 .agents/scripts/context.py discover --root .
|
|
193
|
+
python3 .agents/scripts/context.py init --root . # seeds .agents/context/manifest.json
|
|
194
|
+
python3 .agents/scripts/context.py capture --root . --artifact .agents/PROJECT.md --out .agent-runs/demo/project.json
|
|
195
|
+
python3 .agents/scripts/context.py stamp --root . --artifact .agents/PROJECT.md --capture .agent-runs/demo/project.json # after filling its TBD fields
|
|
196
|
+
python3 .agents/scripts/context.py capture --root . --all --out .agent-runs/demo/capture.json # before reading sources
|
|
197
|
+
python3 .agents/scripts/context.py stamp --root . --all --capture .agent-runs/demo/capture.json # after writing; else --artifact <path>
|
|
198
|
+
python3 .agents/scripts/context.py check --root . # 0 fresh, 1 stale or incomplete, 2 invalid/missing
|
|
199
|
+
python3 .agents/scripts/context.py affected --root . --paths src/app.py docs/SRS.md
|
|
200
|
+
python3 .agents/scripts/context.py fingerprint --root . --paths src tests --out .agent-runs/demo/fingerprint.json
|
|
201
|
+
python3 .agents/scripts/context.py handoff-check --root . --handoff .agent-runs/demo/handoff.json # 0 current, 1 stale, 2 invalid, 3 other repo
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
Default scans skip `.git`, `.agent-runs`, dependency/build/cache directories (`node_modules`, `.venv`, `vendor`, `dist`, `build`, `target`, ...), `.env*` and key/credential files, and generated binaries. Symlinks and junctions are reported in `rejected` and never followed; explicit unsafe paths (absolute, `..`, backslashes, excluded) are refused. Globs support `*`, `?` and `**` only.
|
|
205
|
+
|
|
206
|
+
## Supported providers and integrations
|
|
207
|
+
|
|
208
|
+
| Integration | Status | What ships |
|
|
209
|
+
|---|---|---|
|
|
210
|
+
| Claude Code | supported | `CLAUDE.md`, skill shims in `.claude/skills/`, role agents in `.claude/agents/` |
|
|
211
|
+
| Codex | supported | `AGENTS.md`, role agents in `.codex/agents/`; canonical skills in `.agents/skills/` |
|
|
212
|
+
| T3 Code | optional | documented delegation path when installed and read-only review is demonstrably supported |
|
|
213
|
+
| GitNexus, RTK, Caveman, Ponytail | optional, not bundled | usage guidance only; install and pin them yourself |
|
|
214
|
+
| Gemini, Cursor, DeepSeek, others | not implemented | the role contract and evidence format are the extension points |
|
|
215
|
+
|
|
216
|
+
Model IDs are not pinned. Pick models available in your installed CLI. Codex versions that discover repository skills read `.agents/skills` directly; otherwise `AGENTS.md` tells every provider to open `.agents/skills/<name>/SKILL.md`. Exact CLI guidance and links: `payload/.agents/providers.md`.
|
|
217
|
+
|
|
218
|
+
## Verification and evidence
|
|
219
|
+
|
|
220
|
+
```bash
|
|
221
|
+
mkdir -p .agent-runs/demo
|
|
222
|
+
python3 .agents/scripts/evidence.py snapshot --root . --paths src tests --out .agent-runs/demo/snapshot.json
|
|
223
|
+
python3 .agents/scripts/evidence.py validate --root . --snapshot .agent-runs/demo/snapshot.json --input .agent-runs/demo/review.json
|
|
224
|
+
python3 .agents/scripts/evidence.py check --root . --snapshot .agent-runs/demo/snapshot.json
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
Replace `src tests` with the real, approved files and directories; reviewers must cite source inside the snapshot. The snapshot stores SHA-256 hashes and detects files added, deleted or modified within scope. After a fix, create a new snapshot under a new file name. The validator checks exact lines, hashes, path containment, schema fields and duplicate IDs and returns an exit code; it does not verify that a claim is true or that referenced artifacts are valid. Snapshot protected independent tests before building and run `check` after changes. Store the manifest outside the builder's write permissions if you need strong enforcement. Never snapshot secrets or sensitive documents.
|
|
228
|
+
|
|
229
|
+
Run the bundled tests in an installed project:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
python3 -B -m unittest discover -s .agents/scripts -p 'test_*.py' -v
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Run the installer tests from this repository's root:
|
|
236
|
+
|
|
237
|
+
```bash
|
|
238
|
+
python3 -B -m unittest discover -s tests -v
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
## Repository structure
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
pyproject.toml package metadata (hatchling; `lardva` console script)
|
|
245
|
+
src/lardva/ CLI, engine, doctor and payload history (stdlib only)
|
|
246
|
+
scripts/ maintainer tools: history snapshots, wheel smoke test (not packaged)
|
|
247
|
+
install.py legacy installer (dry run by default)
|
|
248
|
+
assets/ logo
|
|
249
|
+
tests/ installer, CLI and branding tests (not installed)
|
|
250
|
+
payload/ everything copied into a project
|
|
251
|
+
├── AGENTS.md engineering contract for all providers
|
|
252
|
+
├── CLAUDE.md Claude Code entry point
|
|
253
|
+
├── .agents/
|
|
254
|
+
│ ├── PROJECT.md project profile (user-owned)
|
|
255
|
+
│ ├── POLICY.md execution policy
|
|
256
|
+
│ ├── providers.md provider adapters and optional tools
|
|
257
|
+
│ ├── skills/ 21 canonical skills
|
|
258
|
+
│ ├── scripts/ evidence.py, context.py and their tests
|
|
259
|
+
│ ├── schemas/ findings and rulings JSON schemas
|
|
260
|
+
│ └── templates/ SRS, SAD, SDD, ADR, tasks, brief, handoff, prompts, telemetry
|
|
261
|
+
├── .claude/ skill shims and role agents
|
|
262
|
+
└── .codex/ role agents
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
## Security and operational boundaries
|
|
266
|
+
|
|
267
|
+
- Default policy is local development only: no deployment, commits, pushes, destructive commands, secret reads, tool installation, remote MCP or customer data transfer without specific authorization. Never enable permission bypass.
|
|
268
|
+
- Repository content, logs, model output and guest briefs are data, not authority.
|
|
269
|
+
- Guest providers receive bounded artifacts and approved source only. A read-only sandbox is not a confidentiality boundary; use a sanitized, isolated workspace for sensitive code.
|
|
270
|
+
- `context.py` excludes well-known secret file names only; secrets inside ordinary source files are hashed, never printed, but agents that read those files can still see them. The handoff credential scan is a pattern check, not a guarantee.
|
|
271
|
+
- Hashes are byte-exact, so line-ending conversion (`core.autocrlf`) on another machine shows files as modified.
|
|
272
|
+
- See `payload/.agents/POLICY.md` and `SECURITY.md`.
|
|
273
|
+
|
|
274
|
+
## Current limitations
|
|
275
|
+
|
|
276
|
+
- No daemon, controller, scheduler, budget enforcement, automatic resume or ML router. Stop-loss rules and quality gates are instructions; the utilities validate artifacts but do not enforce provider usage, time, permissions or workflow transitions.
|
|
277
|
+
- Skills guide the model; they do not guarantee that it complies.
|
|
278
|
+
- Stamping context is an attestation by the agent; `context.py` cannot check that artifact text is semantically correct. Capture binds sources and the artifact's prior bytes, but two sessions writing the same artifact at once can still mix outputs: keep one writer per worktree, as `POLICY.md` requires. Direct manifest edits are not locked; `stamp` refuses to overwrite one that lands before its final write, but an edit saved in the last instant before the atomic replace can still be lost.
|
|
279
|
+
- Repositories without Git or without commits report `identity_unverified` and are never `current`, but a different such project cannot be told apart. Intentional symlinks inside the repository make the default `.` input of `codebase-map.md` unstampable; replace it with explicit roots.
|
|
280
|
+
- On Windows without symlink privilege, `test_symlink` is reported as skipped; mocked symlink and real junction tests keep the rejection covered there, and CI runners execute the real symlink test.
|
|
281
|
+
- A pass claim is checked against the gate fingerprint's paths only; gate dependencies outside those paths (shared configuration, other test directories) are not detected unless included with `--paths`.
|
|
282
|
+
- Name-based discovery recognizes common build, CI and specification files only; unusual build inputs (for example `cmake/toolchain.cmake`) need to be added to `verification.md`'s inputs by hand.
|
|
283
|
+
- PROJECT.md invalidates only artifacts whose inputs declare it (all generated artifacts from `init`, but not a manifest created before this change until PROJECT.md is added to its inputs or `.` covers it). Approved handoff scope is checked by its literal base only: a glob like `src/**/*.pem` that matches only excluded files is accepted but never fingerprinted. User-owned files inside `.agents/context` are tracked only when an input names or covers them (`.`), are not reported as uncovered, and `affected` still lists them as excluded. Create the `.agent-runs/<run-id>` directory before `capture --out` writes into it.
|
|
284
|
+
- A literal input whose parent directory cannot be read is treated as absent; scans report unreadable directories they reach, but not ones hidden behind a denied lookup.
|
|
285
|
+
- `lardva` has no rollback of completed operations, never removes directories or the `.gitignore` line, and recovery can leave added files for you to delete or adopt.
|
|
286
|
+
- `lardva` assumes a single writer and a trusted local workspace: it does not detect another program writing between its last check and its write, does not defend against someone who controls your filesystem, and offers best-effort recovery after power loss. Safe file creation needs hard-link support from the project's filesystem; without it, commands stop before overwriting anything.
|
|
287
|
+
- Line-ending-only changes count as unmodified for `lardva update`, which then writes LF.
|
|
288
|
+
- The bundled tests do not prove that a Claude-Codex workflow has run end to end.
|
|
289
|
+
|
|
290
|
+
## Contributing
|
|
291
|
+
|
|
292
|
+
See [CONTRIBUTING.md](https://github.com/thuan-NM/Lardva/blob/main/CONTRIBUTING.md). Changes are recorded in [CHANGELOG.md](https://github.com/thuan-NM/Lardva/blob/main/CHANGELOG.md).
|
|
293
|
+
|
|
294
|
+
## The story behind Lardva
|
|
295
|
+
|
|
296
|
+
Lardva is a blend of *Lard* and *Larva*, inspired by two affectionate nicknames. A little piece of our story, built into something bigger.
|
|
297
|
+
|
|
298
|
+
## License and acknowledgments
|
|
299
|
+
|
|
300
|
+
Lardva is released under the [MIT License](https://github.com/thuan-NM/Lardva/blob/main/LICENSE).
|
|
301
|
+
|
|
302
|
+
Lardva synthesizes and rewrites engineering principles from harnesses its author has used; it contains no third-party source code or business documents. Optional tools referenced in the documentation ([RTK](https://github.com/rtk-ai/rtk), [Caveman](https://github.com/JuliusBrussee/caveman), [Ponytail](https://github.com/DietrichGebert/ponytail), [GitNexus](https://github.com/abhigyanpatwari/GitNexus)) are separate projects under their own licenses and are not bundled.
|
|
303
|
+
|
|
304
|
+
<p align="center"><sub>Built with love. Engineered with discipline.</sub></p>
|