@aliip/pilah 0.0.0-stage → 1.0.1
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/BUILD_STATUS.md +23 -0
- package/LICENSE +21 -0
- package/README.md +108 -2
- package/assets/logo.svg +5 -0
- package/docs/ACCEPTANCE_GATE.md +41 -0
- package/docs/ADAPTIVE_RCA_WORKFLOW.md +93 -0
- package/docs/AGENT_DECISION_REVIEW.md +17 -0
- package/docs/ALWAYS_ON_5_WHYS.md +75 -0
- package/docs/ARCHITECTURE.md +43 -0
- package/docs/BEHAVIORAL_5_WHYS_V2_0_1.md +117 -0
- package/docs/CHECKPOINT_RECOVERY.md +86 -0
- package/docs/CI_EFFICIENCY.md +63 -0
- package/docs/COMPATIBILITY.md +84 -0
- package/docs/CONTRACTS.md +177 -0
- package/docs/CONVERSATION_USAGE.md +52 -0
- package/docs/ENGINEERING_METHOD.md +68 -0
- package/docs/HOST_VALIDATION.md +35 -0
- package/docs/INDEPENDENT_ACCEPTANCE_RUNBOOK.md +72 -0
- package/docs/INTERVENTION_LEDGER.md +25 -0
- package/docs/MAIN_VALIDATION_BACKLOG.md +19 -0
- package/docs/NATIVE_FIRST_WORKFLOW.md +27 -0
- package/docs/OPEN_SOURCE_ENGINEERING_STANDARDS.md +62 -0
- package/docs/ORCHESTRATION_ADVISOR.md +36 -0
- package/docs/PRE_VNEXT_INTEGRATION.md +27 -0
- package/docs/README.md +54 -0
- package/docs/RELEASE.md +33 -0
- package/docs/RELEASE_AUTHORIZATION.md +33 -0
- package/docs/RISK_GUIDANCE.md +18 -0
- package/docs/SECURITY.md +76 -0
- package/docs/SECURITY_RELIABILITY_AUDIT_V2_0_1.md +55 -0
- package/docs/SEMANTIC_EVIDENCE.md +27 -0
- package/docs/SOURCES.md +13 -0
- package/docs/TOKEN_EFFICIENCY.md +71 -0
- package/docs/TOKEN_PROVENANCE.md +15 -0
- package/docs/V2_0_1_TRACEABILITY.md +66 -0
- package/hooks.json +45 -0
- package/mcp_config.json +16 -0
- package/package.json +31 -4
- package/plugin.json +27 -0
- package/rules/AGENTS.md +2 -0
- package/schemas/database.sql +84 -0
- package/schemas/mcp-tools.json +552 -0
- package/scripts/a2a.mjs +344 -0
- package/scripts/check-release.mjs +42 -0
- package/scripts/check-syntax.mjs +30 -0
- package/scripts/checkpoint.mjs +50 -0
- package/scripts/compare-agent-traces.mjs +53 -0
- package/scripts/context-guardian.mjs +132 -0
- package/scripts/evaluate-acceptance.mjs +110 -0
- package/scripts/export-benchmark.mjs +31 -0
- package/scripts/generate-contracts.mjs +6 -0
- package/scripts/hook.mjs +406 -0
- package/scripts/host-check.mjs +40 -0
- package/scripts/intervention-ledger.mjs +94 -0
- package/scripts/pilah.mjs +3 -0
- package/scripts/release-authorization.mjs +137 -0
- package/scripts/review-agent-decisions.mjs +34 -0
- package/scripts/semantic-evidence.mjs +15 -0
- package/scripts/verifykit.mjs +3 -0
- package/skills/pilah/SKILL.md +24 -0
- package/src/acceptance-matrix.mjs +84 -0
- package/src/browser-evidence.mjs +40 -0
- package/src/context-health.mjs +14 -0
- package/src/conversations.mjs +302 -0
- package/src/engine.mjs +494 -0
- package/src/graph.mjs +169 -0
- package/src/mcp-diagnostics.mjs +53 -0
- package/src/mcp.mjs +151 -0
- package/src/model-recovery.mjs +108 -0
- package/src/native-tool-recovery.mjs +45 -0
- package/src/node-runtime.mjs +13 -0
- package/src/orchestration-advisor.mjs +24 -0
- package/src/rca.mjs +174 -0
- package/src/risk-guidance.mjs +95 -0
- package/src/scanner.mjs +303 -0
- package/src/security.mjs +793 -0
- package/src/semantic-evidence.mjs +144 -0
- package/src/skill-discovery.mjs +23 -0
- package/src/sqlite-compat.mjs +11 -0
- package/src/storage.mjs +455 -0
- package/src/tokens.mjs +627 -0
- package/src/tools.mjs +164 -0
- package/src/verification.mjs +567 -0
- package/src/workflow-router.mjs +34 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Independent validation runbook — PILAH v2.0.1
|
|
2
|
+
|
|
3
|
+
This is an **execution checklist**, not a report claiming these tests were run.
|
|
4
|
+
Never modify the four original STOCKROOM benchmark ZIPs. Copy to disposable test workspaces.
|
|
5
|
+
PR #29 was merged into the dedicated `v2.0.1` branch at commit `049a5297fbd4c542918f4a23e9676d5e2b0530ce`; #16–#27 were subsequently individually merged into `v2.0.1`, and `main` remains unchanged. This is a version-branch merge, not a published or independently validated release.
|
|
6
|
+
|
|
7
|
+
## 1. Reproducible installed-plugin environment
|
|
8
|
+
- Antigravity with documented native CLI/MCP/browser access, explicitly authorized **temporary** workspace.
|
|
9
|
+
- Node 22.13+; PHP/Laravel dependencies and the database driver matching the original test environment; Chrome/Chrome for Testing.
|
|
10
|
+
- Separate model quotas/accounts do not imply equivalent token budgets. Obtain official CLI usage if exposed.
|
|
11
|
+
- Separate browser profiles, isolated credentials, synthetic tenants/stores/users, and local test databases. Do not test mutations against production.
|
|
12
|
+
- Independent evaluator generates test assertions and Ed25519 receipts; the coding agent must not control the signing key or its trusted public-key configuration.
|
|
13
|
+
|
|
14
|
+
## 2. Local PILAH quality gate (repository checkout)
|
|
15
|
+
```sh
|
|
16
|
+
npm test
|
|
17
|
+
node scripts/check-release.mjs
|
|
18
|
+
npm pack --dry-run
|
|
19
|
+
node scripts/pilah.mjs doctor
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Verify MCP `tools/list` exposes **exactly four** tools and `pilah_verify` includes assess, assess_release, assess_semantic, assess_browser and verify_handoff. Verify workspace-trust rejection and source-revision invalidation after file changes. The test suite is intended for Linux/macOS/Windows on Node 22/24. No agent/browser is automatically spawned by PILAH.
|
|
23
|
+
|
|
24
|
+
## 3. Frozen 18-case external acceptance matrix
|
|
25
|
+
Use `tests/fixtures/acceptance-18.json` for IDs F01–F18; every case begins **not tested**. The external runner must issue **real HTTP/browser/database** operations against each generated app copied from frozen ZIPs.
|
|
26
|
+
|
|
27
|
+
- F01–F03: deny unauthorized roles and foreign-store/related IDs, then query the database for zero changes.
|
|
28
|
+
- F04–F07: verify exact price, tax, payments, duplicate-line refund and money-only refund stock invariants.
|
|
29
|
+
- F08–F09: **two independent DB connections with overlapping transactions** for last-stock and transfer receive/cancel (no sequential mock).
|
|
30
|
+
- F10–F11: kill **entire** browser process, restart with persistent profile, test offline queue and cross-account cache.
|
|
31
|
+
- F12: inject network response loss after committed DB transaction, retry exact operation ID and mutate payload to prove conflict.
|
|
32
|
+
- F13–F16: negative RBAC browser assertion, reject self-declared witnesses, production demo credential lockout, sanitized backend exceptions.
|
|
33
|
+
- F17: source snapshot differs from served build; evidence must become stale.
|
|
34
|
+
- F18: differing test counts without a common external suite must **not** produce a winner.
|
|
35
|
+
|
|
36
|
+
No unit-test name, human prose or custom JSON witness list may be accepted as proof of actual concurrency or complete offline restart.
|
|
37
|
+
|
|
38
|
+
## 4. Machine evidence and signed trust
|
|
39
|
+
- Report each scenario with source revision, test report hash, timestamp, runner metadata and actual external assertions. Attach browser/build digest and observed backend row counts.
|
|
40
|
+
- For browser results, `pilah_verify(operation="assess_browser",artifact="...")` must return `inconclusive` or `evidence-present-unattested` unless separately corroborated; it must **never** certify production readiness.
|
|
41
|
+
- `pilah_verify(operation="assess_semantic",artifact="...")` computes structural scenario conditions but **never** authenticates a self-supplied runner.
|
|
42
|
+
- Set up a separate, frozen acceptance registry at `~/.config/pilah/acceptance-registry.json` with matching scenario IDs, requirement SHA-256 digests, criticality, and required evidence types. **Absent or altered scope must block release eligibility**. The coding agent may not edit this file.
|
|
43
|
+
- Set up `~/.config/pilah/trusted-evaluators.json` with evaluator **public** keys under independent user control, and sign each evidence payload with the evaluator private key after running the actual tests.
|
|
44
|
+
- `pilah_verify(operation="assess_release",artifact="...")` only offers eligible-for-review when signatures, revisions, required evidence types and critical blockers are all satisfied. A valid signature does not itself prove that tests executed honestly.
|
|
45
|
+
- Treat critical unproven cases as blockers and preserve report state `inconclusive`.
|
|
46
|
+
|
|
47
|
+
## 5. Benchmark attribution and privacy
|
|
48
|
+
- Compare Native versus old main versus isolated integration candidate in matched runs, and then consider Modern Web Guidance as a **separate** ablation.
|
|
49
|
+
- Include repeated independent runs with matching model/effort/source/evaluator/environment; no reused capture bytes; report interrupted/quota/capacity states separately.
|
|
50
|
+
- Distinguish provider-official usage from local transcript counters, worker overlap and unmeasured PILAH overhead. No causal efficiency claim from Free Tier percentage alone.
|
|
51
|
+
- Before sharing results, use the opt-in `scripts/export-benchmark.mjs` allowlist output, inspect it manually, and do not upload raw brain ZIPs, cookies or database secrets.
|
|
52
|
+
|
|
53
|
+
## 6. Merge policy
|
|
54
|
+
- All 12 original feature PRs #16–#27 and integration PR #29 are **Merged to `v2.0.1`**. Git tree was preserved; implementation issues #3–#14 are closed with outstanding external acceptance tracked in issue #15.
|
|
55
|
+
- Keep `main` unchanged. The `v2.0.1` branch contains the combined implementation; do not publish an npm/GitHub release or promote the version branch to `main` until real external acceptance and Antigravity install/browser smoke checks have passed.
|
|
56
|
+
- The reviewed features are integrated in `v2.0.1` via #29 **and** individually recorded as merged PRs #16–#27; do not merge them again. After independent acceptance and benchmarks pass, open a **single** PR `v2.0.1 → main` and merge it only with explicit user authorization. See [v2.0.1 traceability](./V2_0_1_TRACEABILITY.md).
|
|
57
|
+
|
|
58
|
+
## Current v2.0.1 behavior-specific gates (merged PR #36)
|
|
59
|
+
|
|
60
|
+
The `v2.0.1` candidate includes PR #36 at `67ea5888caf61751952c8a7daa1eb222d738d4b6`. Before live release testing, verify the local plan/assessment contract:
|
|
61
|
+
|
|
62
|
+
1. `pilah_verify(operation="plan")` accepts unique typed `id`, `given`, `when`, `then` and `evidence_type`. For browser/visual paths it additionally requires `viewport`, `ui_state` and `reference`. It must start at **not_tested**.
|
|
63
|
+
2. A passing local build/JUnit/TAP/JSON report can only prove its **named test assertion**. `completion.fully_verified` remains false; browser, visual, hardware, security or independent claims must not receive a local report PASS without real external evidence.
|
|
64
|
+
3. `pilah_evidence(operation="save_checkpoint")` records only explicit bounded `decisions` and `pending_tests`; `model_recovery` detects an old source revision as **stale**. No raw secrets or resume automation.
|
|
65
|
+
4. `pilah_evidence(operation="tool_recovery")` offers **nonexecuting** repair guidance for bad arguments, browser context loss, timeouts, denial, missing files or edit conflicts. It must never echo a private raw error body or bypass authorization.
|
|
66
|
+
5. `pilah_context(action="orchestration")` never launches workers; parallel native modes require low dependency and **independent file ownership**, and explicit user consent.
|
|
67
|
+
|
|
68
|
+
Automated post-merge CI has **213/213 Node assertions passing** on Ubuntu Node 22 and **4/4 OS/runtime jobs**. Its local MCP stdio/SQLite E2E is **not** a replacement for the external test harness described above. The frozen STOCKROOM baseline applications are known-defective **negative controls**, so record their observed failures honestly rather than treating those apps as passing release criteria. The independent evaluator must define exactly what successful PILAH detection/refusal means.
|
|
69
|
+
|
|
70
|
+
## 20 November 2026 addendum (current merged candidate)
|
|
71
|
+
|
|
72
|
+
The security, session, provenance and MCP diagnostics corrections in merged PRs #81–#86 and #88 are integrated into `v2.0.1`; the final combined 9-job Ubuntu/macOS/Windows × Node 22/24/26.13.1 CI run passed. Prior 213/213 and 4/4 statistics above are **historical snapshots**, not this candidate's current CI counts. Recent native test evidence requires an actual `PreToolUse` + matching `PostToolUse` pair and a reporter artifact created/changed during that invocation. This is still **local named-test provenance only** and cannot satisfy the independently signed F01–F18 acceptance requirement by itself. Issue #71 remains open for new installed-IDE agent-choice/skill-inclusion trials; issue #15 remains open for real external HTTP/DB/browser tests and approval. Maintain the original frozen source archives and do not publish or promote to `main`.
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# PILAH Intervention Ledger
|
|
2
|
+
|
|
3
|
+
The source-checkout utility from issue #13 maps **observed** PILAH calls to subsequent observable agent activity without inferring causal effectiveness.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
node scripts/intervention-ledger.mjs transcript.jsonl
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Output contains per-call step, sanitized tool name, result classification, next observable planner step, timestamp and output byte count. Arguments, file paths, raw prompt contents and model text are deliberately omitted. Ambiguous multi-tool steps are marked **incomplete**, not credited.
|
|
10
|
+
|
|
11
|
+
**Important:** a successful `pilah_impact` invocation does not prove PILAH saved tokens or produced a better application. Such statements require matched independent Native/PILAH runs, observable outcome checks and provider-reported usage where available. The ledger may miss calls unavailable in the archived transcript.
|
|
12
|
+
|
|
13
|
+
Current behavioral reliability implementation is in PR #36, merged to `v2.0.1`, but its local E2E does not validate third-party model outcomes. See [token provenance](TOKEN_PROVENANCE.md).
|
|
14
|
+
|
|
15
|
+
### 20 November 2026 classification update
|
|
16
|
+
|
|
17
|
+
PR #86 recognizes Antigravity's direct namespaced tool names such as `pilah_pilah/pilah_context` and `mcp__pilah_pilah__PILAH_context`, in addition to `call_mcp_tool`. A transport-level `DONE` event containing an MCP `status:error`, `isError:true` or categorized code is recorded as a **failed invocation**, not an PILAH success. Output remains metadata-only and will not include command arguments, paths, raw result content or private transcripts. Missing tool results remain unknown, not success. A zero count is an observation of the supplied trace only; it is not evidence that the skill was unavailable, that an agent made a correct skip decision, or that PILAH has no value.
|
|
18
|
+
|
|
19
|
+
### Selection-vs-availability controls (21 November 2026)
|
|
20
|
+
|
|
21
|
+
A complete local archive with 13 distinct full transcripts had 611 native tool calls and zero PILAH calls despite 13 injected Always-On prompts; no bundled trace contained the earlier STOCKROOM Order audit. This is observational, not an independent benchmark. The new eager `pilah_context` registration ensures its full parameter schema *should* be exposed upfront to **enabled parent sessions** under documented Antigravity behavior; it does not guarantee any call or subagent inheritance. Compare high-risk cross-file tasks and a trivial negative control with the same model/effort, record `/mcp`/skill inclusion from the live host and **provider-reported** token usage. Do not infer correct/incorrect tool choice from counts alone.
|
|
22
|
+
|
|
23
|
+
### Eager namespacing accuracy (issue #71)
|
|
24
|
+
|
|
25
|
+
The ledger recognizes Antigravity's native eager function form `mcp_pilah_pilah_PILAH_context` as well as plugin-qualified and lazy forms. A same-named `pilah_context` operation on an unrelated MCP server is **not** an PILAH event. No raw arguments or private output is published. The observed counts remain diagnostic only, not proof of token savings or correct model selection.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# PILAH — independent validation backlog
|
|
2
|
+
|
|
3
|
+
**Updated 24 November 2026.** Source `main` uses PILAH `1.0.0`; GitHub repository remains `the existing repository`. Legacy PILAH issues #15, #71, #91, #92 are closed as **deferred/superseded**, not as successfully tested.
|
|
4
|
+
|
|
5
|
+
## What automated tests establish
|
|
6
|
+
|
|
7
|
+
- PILAH rebrand passed the 9-job Node 22/24/26.13.1 × three-OS CI matrix at the PR #107 source revision.
|
|
8
|
+
- CI/router optimization passed 3/3 main Node 24 jobs at commit `3b168e3`.
|
|
9
|
+
- Original frozen STOCKROOM snapshots passed PHP **syntax** checks (Native 101/101, PILAH 80/80), not live F01–F18. PHP extensions, an isolated DB and browser execution were unavailable.
|
|
10
|
+
|
|
11
|
+
## Required independent work
|
|
12
|
+
|
|
13
|
+
1. **Installed PILAH adoption (#71):** use the [independent host runbook](HOST_VALIDATION.md) with H01–H06, then first run `node scripts/pilah.mjs host-check` on an actual Antigravity machine (CLI-only preflight, not E2E). Then run `agy plugin validate --strict .`, inspect `agy plugin list`, check all four `pilah_*` tools in the actual IDE, permission-denial negatives, spontaneous qualified cross-file use, and a trivial no-call control. Inspect actual parent/subagent traces.
|
|
14
|
+
2. **Guardian overhead (#91):** default-off, explicit enabling, preserved user hooks, absolute NVM Node binary, clean disable, and measured per-invocation host latency, CPU and token overhead. No automatic compaction.
|
|
15
|
+
3. **Native vs PILAH (#92):** at least five counterbalanced trials per variant using the [candidate six-scenario suite](../tests/fixtures/pilah-eval-scenarios.json) frozen outside the agent-controlled repository with matching model, effort, source snapshot, permissions and independent task rubric. Record provider-reported usage if available, elapsed time, turns, tool failures, accepted tasks; report missing usage as unknown.
|
|
16
|
+
4. **Acceptance F01–F18 (#15):** run isolated real PHP HTTP/DB/browser scenarios including tenant and role denials, refund/ledger reconciliation, true two-connection concurrency, offline recovery across browser process restarts, exactly-once retries, stale-build checks and frozen independent negative controls. See [scenario fixture](../tests/fixtures/acceptance-18.json) and [runbook](INDEPENDENT_ACCEPTANCE_RUNBOOK.md).
|
|
17
|
+
5. **Release authority:** frozen evaluator-owned registry, signed machine evidence, independent privacy review and detached approval bound to the exact commit. Verify with the [fail-closed authorization mechanism](RELEASE_AUTHORIZATION.md).
|
|
18
|
+
|
|
19
|
+
**Merged to main ≠ installed in a real IDE ≠ independently accepted ≠ published.** No CI PASS, native advice or self-reported transcript substitutes for unexecuted host/app scenarios.
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# PILAH — native-first workflow
|
|
2
|
+
|
|
3
|
+
**Current workflow for PILAH v1.0.0** on Antigravity; replaces historical PILAH branch instructions. The plugin does not launch agents, run browser/terminal tools, edit source, bypass permissions or automatically switch models.
|
|
4
|
+
|
|
5
|
+
## Choose the least expensive sufficient path
|
|
6
|
+
|
|
7
|
+
| Task | PILAH action | Native Antigravity action |
|
|
8
|
+
| --- | --- | --- |
|
|
9
|
+
| Isolated edit, clear bug, documentation or ordinary styling | **0 calls** | Inspect and edit directly, run proportionate tests |
|
|
10
|
+
| Unknown caller or cross-file ownership | At most one scoped `pilah_context(query)` **or** `pilah_impact(summary=true)` | Inspect actual affected code, not the whole repository |
|
|
11
|
+
| High-risk stateful change | `pilah_impact` if uncertainty remains; `pilah_verify(plan)` only if structured acceptance adds value | Test negative paths, tenant/role boundaries, persistence, idempotency, concurrent writes |
|
|
12
|
+
| Ambiguous or recurring failure | Evidence-backed falsifiable RCA; `pilah_evidence` only when opt-in history is genuinely needed | Reproduce → hypothesis → discriminating test → minimal complete fix |
|
|
13
|
+
| UI/browser behavior | Optional typed plan with viewport, state, reference | Run actual browser interactions, responsive and negative states |
|
|
14
|
+
| Long handoff / recovery | Explicit checkpoint, not automatic retention | Confirm completed work, remaining tests, source freshness |
|
|
15
|
+
| Release | Signed external acceptance gate, if supplied | Independently execute real app scenarios and obtain human approval |
|
|
16
|
+
|
|
17
|
+
**No hard quota of one call for every task:** the initial call is scoped; a second distinct call is justified only by new evidence or a different unresolved question. Avoid needless full-file dumps, repetitive token diagnostics and redundant skill loading. For many authorized repetitive operations, a short reviewed native script with bounded output is often better than repeated tool turns; do not bypass approval or inspect private files.
|
|
18
|
+
|
|
19
|
+
## Quality boundary
|
|
20
|
+
|
|
21
|
+
A `pilah_verify(operation="plan")` result starts at `not_tested`. Only actual named test reports can establish local assertions. Local pass ≠ independently accepted E2E, browser/visual parity, real printer or financial/security correctness. `assess_browser` and `assess_semantic` inspect supplied artifacts; they do not independently execute a browser. A false-pass, missing test, stale build or ambiguous run status must stay unresolved. Do not disable tests or narrow scope to manufacture a passing benchmark.
|
|
22
|
+
|
|
23
|
+
## Agent teams and context
|
|
24
|
+
|
|
25
|
+
Native `/teamwork`, worktrees and subagents may be suggested **only** if the actual Antigravity build/account supports them, workstreams have independently owned files and the user opts in. PILAH does not implement distributed worker coordination or separate per-agent model routing. Leave Context Guardian disabled unless explicitly enabled; its 80/140-step milestones are heuristics, not provider context-token thresholds.
|
|
26
|
+
|
|
27
|
+
Use [skill](../skills/pilah/SKILL.md), [engineering method](ENGINEERING_METHOD.md), [contracts](CONTRACTS.md), [CI evaluation](CI_EFFICIENCY.md) and [independent acceptance backlog](MAIN_VALIDATION_BACKLOG.md). Historic `v2.0.1` root-cause reports remain in the [documentation index](README.md) for audit history only.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Open-source engineering principles adopted in PILAH
|
|
2
|
+
|
|
3
|
+
**Scope:** Research-backed coding and review discipline, not imitation of any maintainer's personal style. **PILAH-only implementation:** no new third-party packages, plugins, MCP servers, agents, style frameworks, browser engines, or background services. Antigravity's existing native editor, terminal, test runner, browser and available agent features remain the only execution layer.
|
|
4
|
+
|
|
5
|
+
## What the primary sources actually establish
|
|
6
|
+
|
|
7
|
+
| Project or maintainer | Source-backed practice | PILAH adaptation | Not copied |
|
|
8
|
+
| --- | --- | --- | --- |
|
|
9
|
+
| **Taylor Otwell / Laravel** | Maintainer weighs feature value against added code and long-term breaking/maintenance risk; Laravel contributions separate bugs, compatible features and breaking changes; established style should not crowd out behavioral review | Favor the smallest worthwhile change, preserve public APIs and existing behavior, reject unrelated abstractions, evaluate benefit vs maintenance cost **before** proposing extra automation | Laravel-specific PHP conventions, facades or automatic StyleCI integration |
|
|
10
|
+
| **Evan You / Vue core** | API-changing features need design discussion; fixes avoid unrelated style-only refactors, and performance/size costs matter | Require explicit approval/design discussion for large PILAH MCP surface or schema changes; stick to one focused bug, scoped tests and a performance/response-size check | Vue component style imposed on arbitrary repositories or an extra Vue toolchain |
|
|
11
|
+
| **D. Richard Hipp / SQLite project** | Bugs need reproducible failing tests; code should blend into existing conventions; requirements map to test cases, and checklists are used for releases; no extraneous dependencies in submitted code | Failing regression first, scenario/revision → named test evidence, negative tests and structured release checklist; no dependencies added | SQLite's C-specific indentation/line-length rules or its private test harness |
|
|
12
|
+
| **Sindre Sorhus** | Small focused modules contain complexity; number of lines alone is not the measure of quality | Keep PILAH functions cohesive, deterministic, independently testable, with clear input/output contracts; **reuse PILAH's own internal modules**, not external npm packages | His npm micro-package dependency model (explicitly disallowed here) |
|
|
13
|
+
| **Kent C. Dodds** | Test observable consumer behavior, not private implementation details; such tests avoid false positives and fragile refactors | Assert MCP/CLI behavior and adverse user-facing outcomes, not just internal function names or passing test counts | React Testing Library or any extra testing library |
|
|
14
|
+
| **Ruby on Rails contributors** | Focused fixes, failing tests, changed documentation, component-scoped testing and performance measurements when relevant | Use the native test runner on affected modules first, full repository CI before promotion, and targeted performance benchmarks for performance-changing edits | Rails/Ruby tooling or stylistic rules |
|
|
15
|
+
|
|
16
|
+
Primary sources (consulted 2026-11-18):
|
|
17
|
+
- Taylor Otwell interview: https://leanpub.com/podcasts/leanpub/taylor-otwell-30-08-18
|
|
18
|
+
- Laravel contribution guide: https://laravel.com/framework/docs/13.x/contributions
|
|
19
|
+
- Vue contributor guide: https://github.com/vuejs/core/blob/main/.github/contributing.md
|
|
20
|
+
- SQLite contributor guide: https://github.com/sqlite/sqlite/blob/master/AGENTS.md
|
|
21
|
+
- SQLite quality / requirements mapping: https://www.sqlite.org/qmplan.html
|
|
22
|
+
- Sindre Sorhus, Small Focused Modules: https://sindresorhus.com/blog/small-focused-modules
|
|
23
|
+
- Kent C. Dodds, Testing Implementation Details: https://kentcdodds.com/blog/testing-implementation-details
|
|
24
|
+
- Rails contributing guide: https://guides.rubyonrails.org/contributing_to_ruby_on_rails.html
|
|
25
|
+
|
|
26
|
+
These are sources of **ideas**. PILAH does not import, fetch, execute or install anything from the cited projects at runtime.
|
|
27
|
+
|
|
28
|
+
## PILAH's own maintainer standard (v2.0.1)
|
|
29
|
+
|
|
30
|
+
### Before coding
|
|
31
|
+
1. Confirm the existing behavior, user outcome and expected/actual failure. Reproduce a reported defect with a **failing regression test** whenever feasible.
|
|
32
|
+
2. Identify the relevant existing project conventions and public interface. Prefer minimal changes. Do not run a large refactor, rename or add abstraction unrelated to the task.
|
|
33
|
+
3. Specify negative controls for trust boundaries: authorization, money/ledger, concurrency, repeated requests, stale state and account switching **only where applicable**. For UI issues, identify visible user behavior, keyboard accessibility and observed layout correctness.
|
|
34
|
+
4. Check if a new feature/API is worth its cost: maintenance burden, tokens/context, backward compatibility, runtime performance and test burden. Keep four MCP public tools. Reject redundant orchestration/browser adapters.
|
|
35
|
+
|
|
36
|
+
### While coding
|
|
37
|
+
5. Extend PILAH's existing functions/modules and Node built-ins; **zero added third-party dependencies**. Favor small cohesive functions and explicit contracts without fragmenting into pointless one-line modules.
|
|
38
|
+
6. Reuse native Antigravity commands and permissions; no implicit tool execution or auto-enabling workers. Fail closed on absent evidence, invalid revision, unauthorized workspace and missing acceptance scenarios.
|
|
39
|
+
7. Match **the target repository's own style**, not Taylor Otwell's PHP formatting or Vue/Rails/SQLite naming on foreign codebases. No mandatory cross-language formatting engine.
|
|
40
|
+
|
|
41
|
+
### After coding
|
|
42
|
+
8. Run the narrow failing test then affected suites, release contracts and cross-platform CI. Validate observable MCP/CLI behavior (including structured errors and invalid input), not just source internals.
|
|
43
|
+
9. Record source revision, served/build identity, evaluator, test scope and explicit passed/failed/partial/not-tested. Signed statements are not a substitute for actual independent test execution.
|
|
44
|
+
10. Preserve concise, reviewable PRs. If there are deliberate performance changes, compare representative workloads and bounded context-token/latency overhead. Do not report improvements without measurements.
|
|
45
|
+
11. Do not promote `v2.0.1` to `main` until the separate external acceptance in issue #15 is finished and the user approves.
|
|
46
|
+
|
|
47
|
+
## Built-in implementation: no extra tool call
|
|
48
|
+
|
|
49
|
+
The existing `pilah_verify(operation="plan")` response may include **one compact `maintainer_review` checklist** when the actual changed scope/risk is high. It is a suggestion marked **not-reviewed**; it does not run tests or grant release approval. Low-risk/trivial changes keep the existing zero-call or minimal-output workflow.
|
|
50
|
+
|
|
51
|
+
PILAH must not advertise this checklist as automatically verifying coding quality. The actual indicators are: smaller justified diff, a regression test that fails on broken behavior and passes after the fix, existing API compatibility, no accidental data leak, and external acceptance when relevant.
|
|
52
|
+
|
|
53
|
+
## Quality and token budget
|
|
54
|
+
|
|
55
|
+
- **Zero** PILAH MCP calls when Antigravity already has the answer for a trivial task.
|
|
56
|
+
- At most **one** scoped `pilah_impact` pass plus **one** `pilah_verify plan` when they meaningfully improve a high-risk task (manual exceptions justified by specific new evidence).
|
|
57
|
+
- Keep maintainer guidance bounded, do not inject the whole research document into model context, and never append automatic token reports.
|
|
58
|
+
- Avoid treating module count, test count, lines of code or tool calls as quality. Value comes from correct user-visible behavior and independently verified constraints.
|
|
59
|
+
|
|
60
|
+
## Behavioral acceptance refinement (merged PR #36)
|
|
61
|
+
|
|
62
|
+
The actual v2.0.1 verifier now supports **Given/When/Then** per-criterion acceptance, explicit required evidence type and UI state/viewport/reference. This extends the minimal-diff and regression-first review discipline; it does **not** make PILAH an automated coding-quality reviewer. Ordinary local test assertions never imply independently verified end-to-end behavior. For long-running tasks, preserve concise explicit decisions and untested scenarios in revision-bound checkpoints, then revalidate after edits. See [current contracts](CONTRACTS.md) and [Five Whys](BEHAVIORAL_5_WHYS_V2_0_1.md).
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# PILAH Native Teamwork Advisor — v2.0.1
|
|
2
|
+
|
|
3
|
+
`pilah_context(action="orchestration")` is an **optional, nonexecuting** advisor. It can only recommend native Antigravity capabilities that are explicitly reported as available in the active environment. It does not launch a worker, grant permissions, alter a model or install third-party agent software.
|
|
4
|
+
|
|
5
|
+
## Supported task declaration
|
|
6
|
+
|
|
7
|
+
```json
|
|
8
|
+
{
|
|
9
|
+
"workspace": "/authorized/project",
|
|
10
|
+
"action": "orchestration",
|
|
11
|
+
"task": {
|
|
12
|
+
"tier": "pro",
|
|
13
|
+
"available_commands": ["/swarm", "/teamwork", "@subagent"],
|
|
14
|
+
"workstreams": ["API", "UI", "Independent tests"],
|
|
15
|
+
"dependencies": "low",
|
|
16
|
+
"file_ownership": "independent",
|
|
17
|
+
"milestones": 3,
|
|
18
|
+
"long_horizon": true
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
`tier`, `available_commands`, `workstreams` and `file_ownership` are **declarations**, not automatically discovered entitlements. The recognized commands are `/swarm`, `/teamwork`, `/boost` and `@subagent`. Tier rules are conservative and platform availability may change.
|
|
24
|
+
|
|
25
|
+
## Recommendation conditions
|
|
26
|
+
|
|
27
|
+
| Situation | Recommendation |
|
|
28
|
+
| --- | --- |
|
|
29
|
+
| Missing/unknown native capability, ownership unknown/shared or high coupling | `single-agent` (parallel modes withheld) |
|
|
30
|
+
| 2+ workstreams, dependencies low, ownership explicitly independent, suitable declared native capability | May recommend `/swarm` or `@subagent` depending on reported tier |
|
|
31
|
+
| Multiple milestones and long horizon **plus** independent file ownership and low dependencies | May recommend `/teamwork` if declared available |
|
|
32
|
+
| Hard tightly coupled reasoning with confirmed supported paid mode | May recommend `/boost` for single-agent challenger reasoning, not a parallel worker launch |
|
|
33
|
+
|
|
34
|
+
Even when recommended, `user_approval_required:true`, `automatic_worker_launch:false`. Prevent file ownership conflicts, validate worker MCP permissions independently, and require a named handoff test via `pilah_verify(operation="verify_handoff")`. Parallel execution can cost **more** time/tokens and does not inherently improve quality.
|
|
35
|
+
|
|
36
|
+
The code-level requirements were strengthened in behavioral issue #34, merged through PR #36. Live native capability availability and actual productivity benefits still need an independently controlled test. See [workflow](NATIVE_FIRST_WORKFLOW.md).
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
> **Historical research record:** Product terminology is standardized to PILAH. Earlier test results and open/closed issue states describe historical snapshots, not current release eligibility.
|
|
2
|
+
|
|
3
|
+
# Historical Integration Audit — Merged into v2.0.1
|
|
4
|
+
|
|
5
|
+
The original pre-vNext audit from `main` at `b622110d0feabf469390a41f3c93338053b3c7b6` was superseded by an explicit request to integrate directly into the `v2.0.1` branch, **not vNext**.
|
|
6
|
+
|
|
7
|
+
- Original feature PRs: #16–#27, all individually merged into `v2.0.1` after integration PR #29, retaining the same source tree.
|
|
8
|
+
- Integration PR: #29, merged to `v2.0.1` on 2026-11-18.
|
|
9
|
+
- Merge commit: `049a5297fbd4c542918f4a23e9676d5e2b0530ce`.
|
|
10
|
+
- `package.json` and `plugin.json` both identify version `2.0.1`.
|
|
11
|
+
- Default `main` remains unchanged.
|
|
12
|
+
- CI after all twelve individual merges: the repository's current GitHub URL — success. Implementation issues #3–#14 are closed; actual external validation remains open in #15.
|
|
13
|
+
- This branch merge is **not** an npm publish, GitHub version tag, GitHub Release, or proof that PILAH is production-ready.
|
|
14
|
+
|
|
15
|
+
## Remaining independent release gates
|
|
16
|
+
|
|
17
|
+
1. Execute all 18 frozen STOCKROOM negative-control scenarios against both generated applications using isolated real HTTP, browser and database test harnesses. The fixtures in tests/fixtures are specifications, not a substitute for executions.
|
|
18
|
+
2. Validate a real installed Antigravity plugin with MCP tools, workspace authorization, browser workflow and source/build evidence freshness.
|
|
19
|
+
3. Compare independent model usage, worker overlap, failure recovery and actual application quality against frozen controls.
|
|
20
|
+
4. Confirm the external frozen acceptance registry and trusted evaluator keys are protected from the coding agent.
|
|
21
|
+
5. Obtain separate authorization before publishing packages, creating a public release, or promoting to `main`.
|
|
22
|
+
|
|
23
|
+
See [Independent Acceptance Runbook](./INDEPENDENT_ACCEPTANCE_RUNBOOK.md).
|
|
24
|
+
|
|
25
|
+
## Historical boundary (current as of 18 November 2026)
|
|
26
|
+
|
|
27
|
+
This document records the **earlier #16–#29 integration**, not the latest feature changes. Subsequently PR #36 merged six behavioral implementation issues #30–#35 into `v2.0.1` at `67ea5888caf61751952c8a7daa1eb222d738d4b6`. Post-merge CI passed 4/4 jobs with 213/213 Node tests on Ubuntu Node 22. `main` was not modified; external release acceptance is still open in #15. See [current traceability](V2_0_1_TRACEABILITY.md).
|
package/docs/README.md
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# PILAH documentation
|
|
2
|
+
|
|
3
|
+
**Current project:** PILAH v1.0.0 source in this repository. The repository has **not** been renamed on GitHub and `@aliip/pilah` publication is not verified. Node.js >=22.13.0 is required.
|
|
4
|
+
|
|
5
|
+
Start with the [README](../README.md) for source setup and CLI usage, [build status](../BUILD_STATUS.md) for tested behavior, and [validation backlog](MAIN_VALIDATION_BACKLOG.md) for the outstanding host-run and F01–F18 checks. The four current public tools are `pilah_context`, `pilah_impact`, `pilah_verify`, `pilah_evidence`. Previously registered tool names remain callable for compatibility; public examples use PILAH.
|
|
6
|
+
|
|
7
|
+
**Evidence boundary:** Passing unit/CI tests does not mean an installed Antigravity host, app/browser behavior, token-saving benchmark, or independently signed release has passed. No public package publication has been authorized.
|
|
8
|
+
|
|
9
|
+
## Start here
|
|
10
|
+
|
|
11
|
+
- [Engineering method & Claude Code comparison](ENGINEERING_METHOD.md)
|
|
12
|
+
- [MCP tools, arguments and evidence contracts](CONTRACTS.md)
|
|
13
|
+
- [Components, data flow and boundaries](ARCHITECTURE.md)
|
|
14
|
+
- [When to call PILAH; native-first workflow](NATIVE_FIRST_WORKFLOW.md)
|
|
15
|
+
- [Supported stacks, Node and Antigravity environments](COMPATIBILITY.md)
|
|
16
|
+
- [Workspace trust, privacy and threat model](SECURITY.md)
|
|
17
|
+
|
|
18
|
+
## Operations and evidence
|
|
19
|
+
|
|
20
|
+
- [Installed Antigravity scenarios and host acceptance runbook](HOST_VALIDATION.md)
|
|
21
|
+
|
|
22
|
+
- [One-job PR CI, three-job main CI; honest token benchmarking](CI_EFFICIENCY.md)
|
|
23
|
+
- [Release checklist and required live tests](RELEASE.md)
|
|
24
|
+
- [Signed, fail-closed publication gate](RELEASE_AUTHORIZATION.md)
|
|
25
|
+
- [What is not yet independently proven](MAIN_VALIDATION_BACKLOG.md)
|
|
26
|
+
- [Evidence and release acceptance criteria](ACCEPTANCE_GATE.md)
|
|
27
|
+
- [Production Acceptance F01–F18 independent test runbook](INDEPENDENT_ACCEPTANCE_RUNBOOK.md)
|
|
28
|
+
- [Risk-aware test recommendations](RISK_GUIDANCE.md)
|
|
29
|
+
- [Browser, semantic and local proof boundaries](SEMANTIC_EVIDENCE.md)
|
|
30
|
+
- [Opt-in checkpoints and recovery](CHECKPOINT_RECOVERY.md)
|
|
31
|
+
- [Optional native agent teamwork](ORCHESTRATION_ADVISOR.md)
|
|
32
|
+
- [Local conversation token diagnostics](CONVERSATION_USAGE.md)
|
|
33
|
+
- [What token counts can and cannot establish](TOKEN_PROVENANCE.md)
|
|
34
|
+
- [Observed MCP intervention logging](INTERVENTION_LEDGER.md)
|
|
35
|
+
|
|
36
|
+
## Historical implementation audits and research — reference only
|
|
37
|
+
|
|
38
|
+
These dated records explain earlier decisions; they are **not current installation, CI or release instructions**. Archived notes retain their historical test dates; their displayed terminology is standardized and older results are not current acceptance.
|
|
39
|
+
|
|
40
|
+
- [Initial Five Whys review](5-WHYS.md)
|
|
41
|
+
- [Earlier Always-On incident analysis](ALWAYS_ON_5_WHYS.md)
|
|
42
|
+
- [Adaptive RCA design history](ADAPTIVE_RCA_WORKFLOW.md)
|
|
43
|
+
- [Agent decision findings](AGENT_DECISION_REVIEW.md)
|
|
44
|
+
- [v2.0.1 behavioral Five Whys](BEHAVIORAL_5_WHYS_V2_0_1.md)
|
|
45
|
+
- [Engineering standards research](OPEN_SOURCE_ENGINEERING_STANDARDS.md)
|
|
46
|
+
- [Pre-vNext migration and audit](PRE_VNEXT_INTEGRATION.md)
|
|
47
|
+
- [v2.0.1 security audit](SECURITY_RELIABILITY_AUDIT_V2_0_1.md)
|
|
48
|
+
- [Historical research references](SOURCES.md)
|
|
49
|
+
- [Earlier token-efficiency review](TOKEN_EFFICIENCY.md)
|
|
50
|
+
- [v2.0.1 issue/PR provenance](V2_0_1_TRACEABILITY.md)
|
|
51
|
+
|
|
52
|
+
## Sources of truth
|
|
53
|
+
|
|
54
|
+
The executable `src/tools.mjs`, `plugin.json`, `mcp_config.json`, `hooks.json`, `schemas/mcp-tools.json` and `schemas/database.sql` supersede historical prose. Publication requires the signed gates in [release authorization](RELEASE_AUTHORIZATION.md). Never commit private conversation transcripts, archived project source or credentials.
|
package/docs/RELEASE.md
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# PILAH — release process
|
|
2
|
+
|
|
3
|
+
**Current status: NO-GO (24 November 2026).** Source `main` includes PILAH `1.0.0`; externally signed F01–F18 and installed Antigravity host acceptance are **not verified**. No source merge, tag or green CI authorizes publishing on its own. Repository is still `the existing repository`; `@aliip/pilah` has not been verified as published.
|
|
4
|
+
|
|
5
|
+
## Source quality gate
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
node --version
|
|
9
|
+
npm run check
|
|
10
|
+
node scripts/check-release.mjs
|
|
11
|
+
node scripts/pilah.mjs doctor
|
|
12
|
+
npm pack --dry-run
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
These inspect source syntax, full Node tests, MCP/schema/manifest contract, runtime environment and package content. They do **not** prove real project workflows, Antigravity integration or external acceptance.
|
|
16
|
+
|
|
17
|
+
**CI configuration:** PRs run 1 full-suite Ubuntu/Node 24 job, `main` pushes run 3 OS full-suite Node 24 jobs. Before release, manually dispatch the complete **9-job** Ubuntu/macOS/Windows × Node 22/24/26.13.1 matrix. See [CI budget](CI_EFFICIENCY.md).
|
|
18
|
+
|
|
19
|
+
## Installed Antigravity gate
|
|
20
|
+
|
|
21
|
+
Run `node scripts/pilah.mjs host-check` on the machine with the actual Antigravity CLI. It must report a local preflight result and explicitly preserves `live_agent_adoption: not_tested`; that result is **not** a substitute for in-IDE behavioral acceptance.
|
|
22
|
+
|
|
23
|
+
Run `agy plugin validate --strict .` and inspect `agy plugin list` on the exact source. Test the four new `pilah_*` MCP tools with authorized and denied workspaces in actual Antigravity. Check plugin restart, NVM Node PATH, lazy tool discovery, user workspace trust, worktrees and meaningful native project tests. A source-level MCP subprocess test is not a live plugin test.
|
|
24
|
+
|
|
25
|
+
## Independent application and release gate
|
|
26
|
+
|
|
27
|
+
- Execute the frozen [STOCKROOM F01–F18 scenarios](INDEPENDENT_ACCEPTANCE_RUNBOOK.md) in a real, isolated HTTP/database/browser environment, including negative and concurrency cases.
|
|
28
|
+
- Run matched Native-vs-PILAH evaluations under controlled trials. Avoid false claims about quota percentages and token savings.
|
|
29
|
+
- Review privacy, evidence source revisions, scope binding and named test provenance. False PASS or stale signatures must fail closed.
|
|
30
|
+
- Satisfy the [independently signed package-release authorization](RELEASE_AUTHORIZATION.md), including immutable registry, evaluator keys, trusted F01–F18 results and human approval for the exact `main` commit.
|
|
31
|
+
- Only after authorization should the separately guarded npm/GitHub Packages workflows publish. The source manifest alone is not proof of package availability.
|
|
32
|
+
|
|
33
|
+
See [build status](../BUILD_STATUS.md) and [open evidence backlog](MAIN_VALIDATION_BACKLOG.md). Legacy `v2.0.1` promotion instructions are historical in [traceability](V2_0_1_TRACEABILITY.md), not active release instructions.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# PILAH — independently authorized releases
|
|
2
|
+
|
|
3
|
+
**Status: NO-GO.** PILAH's source manifest is version `1.0.0`, but independent installed-host and F01–F18 acceptance have not been completed and signed. A green CI, merged PR, Git tag, manual workflow dispatch or GitHub Release is **not** authorization to publish.
|
|
4
|
+
|
|
5
|
+
## Executable authority
|
|
6
|
+
|
|
7
|
+
The actual release contract lives in [`scripts/release-authorization.mjs`](../scripts/release-authorization.mjs), [`scripts/evaluate-acceptance.mjs`](../scripts/evaluate-acceptance.mjs), the checked-in [release test suite](../tests/release_authorization.test.mjs) and [publishing workflows](../.github/workflows/publish-npm.yml). The existing internal configuration names, signed payload identifiers and repository identity remain unchanged for backward compatibility. **Do not derive new names from the PILAH brand.** Use those source files for the exact names and formats; this guide intentionally does not duplicate or rename internal identifiers.
|
|
8
|
+
|
|
9
|
+
## Mandatory gate
|
|
10
|
+
|
|
11
|
+
1. The publishing checkout must match the **current approved `main` commit** and the actual repository identity expected by the validator. Tag-triggered publication requires an exact `v<package.json version>` tag; manual dispatch must use the permitted branch.
|
|
12
|
+
2. An independently configured repository variable must pin the approved 40-character commit SHA. There is no automatic approval or emergency bypass.
|
|
13
|
+
3. Externally controlled secrets must provide an evidence manifest, a frozen acceptance registry, and pinned evaluator/reviewer **Ed25519 public keys**. Their exact key names are in the publishing workflow.
|
|
14
|
+
4. All required frozen scenarios **F01–F18** must be independently executed, source-bound and supported by valid signed machine-evidence receipts. Missing, partial, stale, self-asserted or inconsistent reports must fail closed.
|
|
15
|
+
5. The reviewer must independently confirm an installed Antigravity host test, a privacy review and matched repeated evaluation. Repository unit tests are not substitutes.
|
|
16
|
+
6. A **separate detached Ed25519 approval signature** must bind the target repository, commit, package version, source revision, registry digest, completion flags and approval time. Keep private signing keys outside the repository and CI. Expired or future-dated approvals are rejected.
|
|
17
|
+
7. The publishing workflows must re-run authorization at the actual target commit before any package upload.
|
|
18
|
+
|
|
19
|
+
## Negative controls and evidence integrity
|
|
20
|
+
|
|
21
|
+
Historical STOCKROOM snapshots include deliberately defective examples. **They are negative controls**, not releasable applications proven correct. The evaluator may verify that PILAH correctly identifies missing evidence or unsafe behavior, but must never relabel a defective application as meeting financial, security, offline or concurrency requirements.
|
|
22
|
+
|
|
23
|
+
Signed passing evidence must correspond to the exact tested code, declared scenario, required evidence type and real execution. Screenshots, passing build logs and test titles alone do not demonstrate transaction correctness, real browser sessions, hardware access or independent acceptance.
|
|
24
|
+
|
|
25
|
+
## Release procedure
|
|
26
|
+
|
|
27
|
+
1. Run `npm run check`, `node scripts/check-release.mjs`, package hygiene checks and the manually dispatched complete **nine-job** cross-platform Node compatibility matrix.
|
|
28
|
+
2. Perform live PILAH plugin validation on the installed host and independent [application acceptance](INDEPENDENT_ACCEPTANCE_RUNBOOK.md).
|
|
29
|
+
3. Review the [validation backlog](MAIN_VALIDATION_BACKLOG.md), privacy findings, complete frozen scenario results, model token measurements and all negative controls.
|
|
30
|
+
4. Obtain externally pinned signatures and explicit maintainer approval for the **exact commit**.
|
|
31
|
+
5. Only then trigger the signed publishing workflows. A package manifest does not prove a package exists in a registry.
|
|
32
|
+
|
|
33
|
+
For the latest evidence and caveats see [build status](../BUILD_STATUS.md) and [release process](RELEASE.md). **No publication is implied by this documentation.**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
# Context-aware verification guidance (issue #10)
|
|
2
|
+
|
|
3
|
+
PILAH's existing `pilah_verify(operation="plan")` response now contains `risk_guidance`. This is a **non-blocking, framework-neutral checklist** triggered by relevant changed paths and acceptance criteria. It covers tenant authorization, server-side financial integrity, inventory concurrency and offline queue recovery.
|
|
4
|
+
|
|
5
|
+
Every recommendation remains `not-run` until independently tested. Keyword matches are heuristics: suggestions do not prove vulnerabilities, and no match does **not** prove security. Existing evidence gates, workspace trust, and native Antigravity permissions remain unchanged.
|
|
6
|
+
|
|
7
|
+
Research motivation: Google DeepMind's agent workflow work emphasizes correct tool use and independent validation, rather than accepting a model's prose claims. See https://deepmind.google/blog/agentic-cheminformatics-with-google-antigravity/ and the original STOCKROOM audit.
|
|
8
|
+
|
|
9
|
+
**Pre-vNext additions:** Domain-specific, unexecuted negative tests now include server-authoritative price and payment reconciliation; duplicate refund lines and monetary-only refunds; last-stock and transfer concurrency; idempotency conflicting payload; authorization across routes, services, offline sync and background handlers; tenant/store relational ownership; browser account/cache isolation; demo credentials, invitation and rate limiting; UI accessibility. Risk plans are `status:not-run` and `coverage_assurance:none`, **never** a finding of an exploitable vulnerability or a release pass. `routes/web.php` and `PosController.php` now trigger specific high-risk templates.
|
|
10
|
+
|
|
11
|
+
## Structured negative controls and completion (PR #36)
|
|
12
|
+
|
|
13
|
+
When a high-risk user request is specific, prefer a **typed** `pilah_verify` plan: `id`, `given`, `when`, `then`, `evidence_type`, `negative` and any required UI state/viewport/reference. A domain heuristic only **suggests** relevant scenarios; it cannot claim that any route, refund, concurrency edge or UI interaction was tested. Plans report `completion.fully_verified:false`; after native tests, assess exact named assertions and report remaining **not_tested/blocked/stale** cases. See [contracts](CONTRACTS.md) and [behavioral Five Whys](BEHAVIORAL_5_WHYS_V2_0_1.md).
|
|
14
|
+
|
|
15
|
+
## Risk suggestions are advisory, never mandatory by regex
|
|
16
|
+
|
|
17
|
+
`proposeRiskTests` matches static path/criterion patterns, not proven vulnerabilities. Its historical `required_test_ids` field is now empty; use `suggested_test_ids` plus `suggested_total`, `suggested_visible`, and `more_available` for preview. In default Compact mode it ranks up to three candidate tests by task wording and returns counts for omitted scenarios **without hiding critical domain matches**; explicit Compact-off expands the full list. The agent/user must adopt and bind relevant tests using `pilah_verify(plan,persist_plan:true)` before they become required. A suggested negative control, even if relevant to a 5 Whys hypothesis, has status `not-run` until actual testing. [Adaptive RCA protocol](ADAPTIVE_RCA_WORKFLOW.md).
|
|
18
|
+
|
package/docs/SECURITY.md
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# PILAH — threat model and safety boundaries
|
|
2
|
+
|
|
3
|
+
## Trust boundaries
|
|
4
|
+
|
|
5
|
+
1. **Agent to MCP:** requests are untrusted inputs. Schema validation checks known arguments, array item schemas, types, bounds, and unknown keys, and the engine enforces path and size limits.
|
|
6
|
+
2. **MCP to filesystem:** workspaces must be explicitly authorized via the CLI (`node scripts/pilah.mjs allow <path>`) or present in Antigravity's built-in user trust lists (IDE `state.vscdb` Workspace Trust `content.trust.model.key` and CLI `trustedWorkspaces`), configurable via `autoTrust` (`antigravity-trust` | `active-only` | `project-markers` | `off`). Explicit revocation overrides all automatic trust. `active-only` requires a workspace found in both the IDE/CLI trust sources and the latest bounded SessionStart hook record; untrusted process arguments are never accepted as authorization. `project-markers` is an opt-in historical-project discovery mode and must not be used as a substitute for independently reviewed authorization. Protected roots (`/`, `~`, `~/Documents`, `~/Downloads`, `~/Desktop`, `~/Music`, `~/Pictures`, `~/Videos`, `~/.config`, `~/.gemini`, `~/.ssh`, `~/.aws`, `~/.gnupg`, `tmpdir`) are always denied, and upward ancestor authorization is blocked.
|
|
7
|
+
3. **MCP to storage:** indexed code metadata, hashes, evidence, telemetry counters **and explicitly saved local Markdown artifact/checkpoint content** may be persisted in `PLUGIN_DATA` (`the existing SQLite database`). Do not store credentials in user-authored notes; a bounded assignment detector is defense in depth, not full secret detection. Workspace data is keyed by a SHA-256-derived canonical path identity. The DB is local; no outbound network listener is created.
|
|
8
|
+
4. **External test artifacts:** machine-readable reports may be inaccurate or adversarial. Hashing detects later modification but is **not** an authenticity signature; confidence is scoped to supplied artifacts.
|
|
9
|
+
5. **Native Antigravity:** PILAH never increases Google permissions, bypasses sandbox prompts, accesses private endpoints, or impersonates the user's account.
|
|
10
|
+
|
|
11
|
+
## Denied behavior
|
|
12
|
+
|
|
13
|
+
- No automatic `npm install` or arbitrary script execution in project folders.
|
|
14
|
+
- No general `exec`, shell command, write-file, Git mutation, or browser-control MCP tool.
|
|
15
|
+
- Hooks (`hooks.json`) use `SessionStart` and targeted `PostToolUse` to record bounded metadata, native test-run observations and explicitly changed Antigravity brain Markdown snapshots where permitted. They do not run arbitrary project commands, modify repository source, or use `PreInvocation`.
|
|
16
|
+
- No scanning symlink targets, `.env`, keys, credentials, lockfiles, `node_modules`, `vendor`, `.git`, build outputs, or generated caches.
|
|
17
|
+
- No cross-workspace retrieval and no automatic reuse of history from a project with the same basename.
|
|
18
|
+
|
|
19
|
+
## Threat test suite
|
|
20
|
+
|
|
21
|
+
Unit/integration tests include path traversal, hidden secrets, lockfiles, symlink escapes, protected roots, upward authorization rejection, unknown tool arguments and nested array validation, denied workspace reads, incomplete reports, forged totals, missing named tests, stale source, and changed artifacts. Repeat these on Windows with junctions/reparse points, on macOS with symlinks, and on Linux with mixed permissions before release.
|
|
22
|
+
|
|
23
|
+
## Residual risks
|
|
24
|
+
|
|
25
|
+
- MCP calls run with the local user's process permissions, not an OS-level sandbox applied by this plugin.
|
|
26
|
+
- The workspace allowlist can be edited by processes running with the same user's OS permissions.
|
|
27
|
+
- Static analyzers use conservative heuristics rather than full language compiler pipelines.
|
|
28
|
+
- Test report content may be misleading; no cryptographic proof of process provenance is provided.
|
|
29
|
+
- Large repositories are scanned on demand up to configured file/size caps; returned coverage may be incomplete.
|
|
30
|
+
|
|
31
|
+
## Privacy
|
|
32
|
+
|
|
33
|
+
Core MCP, hooks and local analysis make **no automatic outbound network requests**. The explicitly invoked `refresh` CLI command talks only to loopback `ANTIGRAVITY_LS_ADDRESS`; the separate optional `pilah stats` CLI command invokes an authenticated local `gh api` client to fetch GitHub repository traffic metrics over the network. Those repository clone/view counts **do not prove distinct installations**. No source code is uploaded. The allowlist and settings reside under `~/.config/pilah/`; the SQLite database (`the existing SQLite database`) resides in `PLUGIN_DATA` / `~/.gemini/antigravity/plugin_data/pilah` or `~/.config/pilah/data`. Transcript reading is local-only and read-only, skipping subagent transcripts on fallback.
|
|
34
|
+
|
|
35
|
+
## Publication security
|
|
36
|
+
|
|
37
|
+
Package publication is blocked by default unless independently pinned, signed external acceptance evidence and an Ed25519 approval signature bind the exact approved `main` commit, matching tag/package version, frozen F01–F18 registry and human approval variable. See [Release Authorization](./RELEASE_AUTHORIZATION.md). A signed report asserts provenance of a key, not independent truth of the test execution.
|
|
38
|
+
|
|
39
|
+
## Re-audit privacy and provenance controls (19 November 2026)
|
|
40
|
+
|
|
41
|
+
- **Edit-triggered Markdown history requires opt-in.** The default setting `artifact_auto_snapshot=false` prevents PostToolUse from copying full Antigravity brain Markdown into local SQLite/shadow files. This setting is **global across authorized workspaces**, so enabling it permits future edit-triggered snapshots from any authorized project; use `off` when finished. Explicit `pilah artifact-autosnapshot on|off|status` controls future snapshots; it does not purge existing versions.
|
|
42
|
+
- **Explicit acceptance retention:** `persist_plan:true` stores user-authored Given/When/Then and UI references locally, under the authorized workspace with source revision and manifest hash. Avoid placing customer data, credentials or sensitive text in plans. It is off by default.
|
|
43
|
+
- **Native execution status:** an absent top-level error is *not* success. Local test provenance requires an unambiguous zero numeric exit code; failed/unknown events clear positive report hashes and cannot certify user-visible behavior.
|
|
44
|
+
- **Verification scope:** neither local machine test nor native hook metadata independently authenticates visual/browser/hardware/security acceptance. `verify_handoff` and `assess` use one local evidence-type policy.
|
|
45
|
+
- **Permission safety:** error classifier prioritizes authorization-denied signals even in mixed parameter/page ID messages. No retries or bypass occur automatically.
|
|
46
|
+
|
|
47
|
+
These are code-level mitigations. Do not claim independent native Antigravity payload compatibility, cryptographic local test provenance, complete secret detection or any guarantee against same-user filesystem interference.
|
|
48
|
+
|
|
49
|
+
## Behavioral reliability privacy and trust (PR #36)
|
|
50
|
+
|
|
51
|
+
The optional checkpoint API `save_checkpoint` rejects recognizable plaintext credential assignments and binds user-authored decisions/pending scenarios to a source revision. It **does not** prove that notes are factual. `model_recovery` warns when source changes; `tool_recovery` never persists or echoes its error hint and only returns bounded advice. An explicit user-approved environment must be maintained for parallel native workers; PILAH does not confer new permissions. Only **synthetic, sanitized** behavioral regression fixtures were committed; real Antigravity private brain archives remain outside the public repository. See [5 Whys](BEHAVIORAL_5_WHYS_V2_0_1.md) and [contracts](CONTRACTS.md).
|
|
52
|
+
|
|
53
|
+
No authorization, hashing or input sanitizer is an OS-level security sandbox. Symlink and same-user races, test-run provenance and live environment privacy still require independent review before release.
|
|
54
|
+
|
|
55
|
+
## RCA notes, evidence and causal claims (19 November 2026)
|
|
56
|
+
|
|
57
|
+
RCA writes require `persist_rca:true` on each `record_incident`, `add_hypothesis`, or `assess_hypothesis` call. This is an explicit tool argument, **not proof of separate user consent**: agents must only supply it after user-approved retention. User-entered titles, hypotheses, experiment predictions, observations, criteria and candidate causes are bounded and checked for common plaintext secret assignments. This heuristic is **not a comprehensive secret detector**. SQLite records remain on local storage; there is no automatic archive upload. Evidence references are workspace- and revision-bound, report hashes are rechecked, and only exactly named unit/integration assertions may support local experiment interpretations. A local PASS is not a cryptographic witness or independent proof of causality. RCA incident signatures are SHA-256 digests of short normalized title/path descriptors and are only **recurrence hints**. Historical notes are not automatically deleted by disabling snapshot retention. [RCA lifecycle](ADAPTIVE_RCA_WORKFLOW.md).
|
|
58
|
+
|
|
59
|
+
RCA cleanup is available through the existing `pilah_evidence(operation="delete_incident",persist_rca:true,confirm_deletion:true,incident_id:"...")` contract. It removes only the selected incident/hypotheses in an atomic transaction, **not other evidence or plans**. Logical deletion does not securely erase SQLite WAL, backups or filesystem remnants; plan retention separately. Compact history is limited to eight entries by default with omission counters; report artifact integrity is rechecked when a hypothesis is read, not just at the moment of assessment.
|
|
60
|
+
|
|
61
|
+
RCA assessments additionally preserve a local append-only experimental interpretation history; this contains the user/agent observation text and evidence references, not whole test reports. Deleting an incident also deletes that history logically. Persistent SQLite and backups must still be handled under user-controlled retention policies.
|
|
62
|
+
|
|
63
|
+
## Native-run and JUnit/TAP P0 hardening
|
|
64
|
+
|
|
65
|
+
Native test provenance requires an anchored, direct recognized test runner (with narrowly supported optional environment or `cd dir &&` prefix), an explicit successful numeric exit status, and matching local source/report hashes; matching test-runner substrings in unrelated shell commands or exit masking are rejected. This remains local metadata, never independent attestation. JUnit/TAP parsers now reject commented XML, incomplete/aborted TAP reports, malformed assertion numbering and hidden failure states rather than treating them as PASS. Session and optional conversation-metadata reads in CLI/hooks reject symlinked or oversized JSON. Actual Antigravity host payload variants and real user-visible behavior must still be tested externally.
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
## Bounded local I/O and release config diagnostics (v2.0.1)
|
|
69
|
+
|
|
70
|
+
Local evidence metadata and snapshot reads are descriptor-pinned and size-bounded. The evidence history/freshness rehash budget is 4 MiB per artifact; oversized or symlinked metadata cannot establish fresh provenance. A recursive `.code-workspace` chain has a visited-set and depth limit. Workspace-owned side-question IDs cannot overwrite a row belonging to a different workspace. Sensitive independent acceptance files reject symlink leaves and oversized content, and reject unsafe owner-controlled parent links where configured.
|
|
71
|
+
|
|
72
|
+
`assess_release` keeps trusted evaluator keys and frozen registry under `~/.config/pilah/`; on POSIX, group/world-writable files remain invalid. The result provides non-path diagnostics such as `apply chmod 600`, not silent acceptance or misleading PASS. The release manifest is read and SHA-256-hashed from one descriptor-pinned buffer. These are best-effort same-user file hardenings, **not** an OS sandbox or proof of independent execution; live external release gate #15 remains open.
|
|
73
|
+
|
|
74
|
+
## IDE-trust metadata and cross-platform path re-audit
|
|
75
|
+
|
|
76
|
+
The trusted IDE SQLite store state.vscdb is inspected read-only only when its leaf and user-controlled parent directories are non-symlink paths and the database is at most 64 MiB; local CLI/project JSON trust records have 128 KiB input limits. Explicit workspace grants, PILAH settings and SessionStart metadata also reject unsafe or oversized files. Workspace trust and artifacts use consistent path comparison across Windows casing and macOS /private aliases. Storage protects the actual OS home and environment-overridden HOME/USERPROFILE from accidental chmod. These protections cannot defeat malicious same-user processes racing a database pathname at an OS level; PILAH does not create a sandbox.
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
> **Historical research record:** Product terminology is standardized to PILAH; observed results belong to their original source revisions and must not be interpreted as current independent acceptance.
|
|
2
|
+
|
|
3
|
+
# PILAH v2.0.1 — Security, Reliability and Integrity Audit
|
|
4
|
+
**Date:** 18 November 2026
|
|
5
|
+
**Target:** `v2.0.1` only
|
|
6
|
+
**Release verdict:** **NO-GO pending independent acceptance**.
|
|
7
|
+
|
|
8
|
+
## Audit boundaries
|
|
9
|
+
|
|
10
|
+
This audit reviewed PILAH's Node-only MCP/CLI, local workspace authorization, hook/transcript handling, SQLite persistence, evidence assessment, indexing, and cross-platform regression contracts. Changes were made on `v2.0.1` with no new runtime dependencies or public MCP tools. Existing tests and GitHub Actions prove bounded code behavior, **not full operational security or end-to-end acceptance**.
|
|
11
|
+
|
|
12
|
+
## Implemented controls
|
|
13
|
+
|
|
14
|
+
| Area | Code hardening | Regression focus |
|
|
15
|
+
|---|---|---|
|
|
16
|
+
| Workspace trust | Explicit `revoke` is a persistent denial overriding Antigravity's automatic trust; allowing the exact workspace restores access. Broken grants files fail closed. The allow/revoke record is replaced atomically. | Autotrust, revoke, reapprove, corrupt grants |
|
|
17
|
+
| Path boundaries | Protected credential-store descendants and nested ignored paths cannot be ordinary workspace/artifact reads. Brain Markdown exception checks the directory chain for symlinks. | Sensitive subtree and brain symlink escape |
|
|
18
|
+
| RPC and tool input | MCP notifications cannot execute data-changing handlers. Object prototype keys are not accepted as schema fields. The CLI refresh RPC accepts loopback hosts only and does not expose the server error body. | Invalid parameters, no-id calls, CSRF endpoint validation |
|
|
19
|
+
| Session privacy | Transcript reads require an exact Antigravity brain layout, canonical containment, and no symlink components. Session metadata is bounded, atomically replaced, and hooks reject oversized input. | Hook path injection, transcript redirection, large input |
|
|
20
|
+
| SQLite | SQLite and WAL/SHM paths reject symlinks; schema trust is disabled; unverified legacy raw-copy migration fallback was removed. Data directory cannot be root/HOME/shared tmp or world-writable. | File redirection, shared-root permissions |
|
|
21
|
+
| Artifact history | Version allocation and retention are serialized in SQLite. Shadow files remain optional and cannot follow symlinked directories. Explicitly missing versions are reported as missing, not compared with invented empty content. | Multi-version retention, unsafe shadows, missing diffs |
|
|
22
|
+
| Verification | Local multi-criterion evidence and run record writes use a single transaction. Read-only evidence/run freshness recalculates the source fingerprint, while evidence bytes have their own integrity hash. | Rollback on invalid later criterion, stale source edits |
|
|
23
|
+
| Source indexing | Inspect, query, impact, skeleton and verification checks verify source bytes before presenting revision-dependent conclusions. Recognized generated PILAH reports are excluded from the application-source fingerprint, not from independent evidence hashes. | Same-size and same-mtime source changes |
|
|
24
|
+
| Semantic and browser evidence | Built-in semantic requirements cannot be removed by caller input. Duplicate browser assertions are rejected; JSON observations are compared structurally, not by object key insertion order. Reports remain **unattested**. | Bypass attempts, duplicated checks, object-order false negatives |
|
|
25
|
+
| Performance and orchestration | Graph traversal avoids repeated array shifts and correctly reports truncation only when there are unvisited nodes. The agent advisor does not presume paid worker availability or start workers. | Queue traversal, consent/capability constraints |
|
|
26
|
+
|
|
27
|
+
## Verification and safety interpretation
|
|
28
|
+
|
|
29
|
+
CI runs `npm test`, release/schema checks, package dry-run checks, and syntax checks across Ubuntu Node 22/24, Windows Node 22, and macOS Node 22. The GitHub Actions result associated with the final branch head is the authoritative CI evidence; cancelled intermediate pushes are **not** successful validations.
|
|
30
|
+
|
|
31
|
+
An automatically reported `passed` test does not mean a forged/compromised test runner was detected, a browser actually loaded the stated build, or a production system is secure. Evidence reports have explicit provenance and freshness limitations, and external signed evidence still only establishes the configured signer's claim, not the underlying real-world behavior.
|
|
32
|
+
|
|
33
|
+
**Tradeoff:** high-confidence revision-sensitive operations now rehash source content. This avoids stat-cache freshness errors but may increase I/O latency on large workspaces. Run repeatable performance and A/B measurements before claiming a performance improvement. PILAH's static graph and bounded index cannot establish complete runtime coverage.
|
|
34
|
+
|
|
35
|
+
## Blocking work — not certified or complete
|
|
36
|
+
|
|
37
|
+
- Execute all 18 frozen STOCKROOM cases F01–F18 against isolated **running** backend/browser/database systems, including actual overlapping transactions, process-level browser restart, account switching, refunds and tenant security.
|
|
38
|
+
- Perform a fresh real-world Antigravity installation, MCP handshake and permission/revocation smoke test, including an interrupted session and actual OS-specific integration behavior.
|
|
39
|
+
- Run repeated, comparable Native vs prior baseline vs `v2.0.1` Antigravity experiments, with official usage where available and separately scored code quality/acceptance.
|
|
40
|
+
- Independently review test provenance, privacy, malicious same-user filesystem races/TOCTOU, corruption and process-crash fault injection. The code protections are not a substitute for an operating-system-level isolation boundary.
|
|
41
|
+
- Receive explicit human approval before any `v2.0.1` → `main` merge, release tag or npm publication.
|
|
42
|
+
|
|
43
|
+
Follow issue #15 for independent acceptance and [v2.0.1 traceability](./V2_0_1_TRACEABILITY.md) for merge policy.
|
|
44
|
+
|
|
45
|
+
**Guarantees intentionally not made:** zero remaining vulnerabilities; complete runtime dependency or test coverage; independently verified semantic/browser executions; measured token savings; production certification.
|
|
46
|
+
|
|
47
|
+
## Additional release and authorization hardening (18 November 2026)
|
|
48
|
+
|
|
49
|
+
After the initial audit, package publication was made **fail-closed** through an external frozen registry, independently signed scenario evidence, release-attesting Ed25519 reviewer signature, exact `main` SHA match, exact tag/version match, and a separately configured maintainer-approved SHA. Both npm and GitHub Packages workflows reject unapproved releases, including manual dispatch. A spoofable Linux process-argv source of workspace auto-trust was removed. `active-only` auto-trust now intersects IDE/CLI trust state with the current bounded hook workspace rather than treating process names or bare hook paths as grants. No new third-party runtime dependencies were introduced.
|
|
50
|
+
|
|
51
|
+
The private frozen acceptance ZIPs were located and checked independently: 82/82 PHP syntax checks and a Vite build passed for Native; 61/61 PHP syntax checks and a Vite build passed for the PILAH-generated app. PHPUnit **could not start** for either because DOM, mbstring and XMLWriter were absent, so the full 18-case live acceptance remains blocked. See [Release Authorization](./RELEASE_AUTHORIZATION.md).
|
|
52
|
+
|
|
53
|
+
## Behavioral reliability follow-up and interpretation
|
|
54
|
+
|
|
55
|
+
After this security review, PR #36 introduced typed behavioral acceptance, completion summaries that refuse overall verification from local reports, nonexecuting privacy-safe native tool recovery, source-fresh explicit checkpoints and an independent ownership condition for parallel native worker recommendations. The changes merged to `v2.0.1` at `67ea5888caf61751952c8a7daa1eb222d738d4b6`, with 4/4 cross-platform CI jobs passing. These code-level mitigations **do not** close the earlier listed external and operational risks. The current Five Whys analysis is [here](BEHAVIORAL_5_WHYS_V2_0_1.md) and the external blocker remains #15.
|