@aliip/pilah 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/BUILD_STATUS.md +23 -0
  2. package/LICENSE +21 -0
  3. package/README.md +108 -2
  4. package/assets/logo.svg +5 -0
  5. package/docs/AB_EVALUATION.md +62 -0
  6. package/docs/ACCEPTANCE_GATE.md +41 -0
  7. package/docs/ADAPTIVE_RCA_WORKFLOW.md +93 -0
  8. package/docs/AGENT_DECISION_REVIEW.md +17 -0
  9. package/docs/AGENT_TRACE_BENCHMARK.md +17 -0
  10. package/docs/ALWAYS_ON_5_WHYS.md +75 -0
  11. package/docs/ARCHITECTURE.md +43 -0
  12. package/docs/BEHAVIORAL_5_WHYS_V2_0_1.md +117 -0
  13. package/docs/CHECKPOINT_RECOVERY.md +86 -0
  14. package/docs/CI_EFFICIENCY.md +63 -0
  15. package/docs/COMPATIBILITY.md +84 -0
  16. package/docs/CONTRACTS.md +177 -0
  17. package/docs/CONVERSATION_USAGE.md +52 -0
  18. package/docs/ENGINEERING_METHOD.md +68 -0
  19. package/docs/HOST_VALIDATION.md +35 -0
  20. package/docs/INDEPENDENT_ACCEPTANCE_RUNBOOK.md +72 -0
  21. package/docs/INTERVENTION_LEDGER.md +25 -0
  22. package/docs/MAIN_VALIDATION_BACKLOG.md +19 -0
  23. package/docs/NATIVE_FIRST_WORKFLOW.md +27 -0
  24. package/docs/OPEN_SOURCE_ENGINEERING_STANDARDS.md +62 -0
  25. package/docs/ORCHESTRATION_ADVISOR.md +36 -0
  26. package/docs/PRE_VNEXT_INTEGRATION.md +27 -0
  27. package/docs/PRIVATE_BENCHMARK_EXPORT.md +14 -0
  28. package/docs/README.md +58 -0
  29. package/docs/RELEASE.md +33 -0
  30. package/docs/RELEASE_AUTHORIZATION.md +33 -0
  31. package/docs/RISK_GUIDANCE.md +18 -0
  32. package/docs/SECURITY.md +76 -0
  33. package/docs/SECURITY_RELIABILITY_AUDIT_V2_0_1.md +55 -0
  34. package/docs/SEMANTIC_EVIDENCE.md +27 -0
  35. package/docs/SOURCES.md +13 -0
  36. package/docs/STOCKROOM_BENCHMARK_RECHECK_2026_11_18.md +53 -0
  37. package/docs/TOKEN_EFFICIENCY.md +71 -0
  38. package/docs/TOKEN_PROVENANCE.md +15 -0
  39. package/docs/V2_0_1_TRACEABILITY.md +66 -0
  40. package/hooks.json +45 -0
  41. package/mcp_config.json +16 -0
  42. package/package.json +31 -4
  43. package/plugin.json +27 -0
  44. package/rules/AGENTS.md +2 -0
  45. package/schemas/database.sql +84 -0
  46. package/schemas/mcp-tools.json +552 -0
  47. package/scripts/a2a.mjs +343 -0
  48. package/scripts/check-release.mjs +42 -0
  49. package/scripts/check-syntax.mjs +30 -0
  50. package/scripts/checkpoint.mjs +50 -0
  51. package/scripts/compare-agent-traces.mjs +53 -0
  52. package/scripts/context-guardian.mjs +132 -0
  53. package/scripts/evaluate-acceptance.mjs +110 -0
  54. package/scripts/export-benchmark.mjs +31 -0
  55. package/scripts/generate-contracts.mjs +6 -0
  56. package/scripts/hook.mjs +406 -0
  57. package/scripts/host-check.mjs +40 -0
  58. package/scripts/intervention-ledger.mjs +94 -0
  59. package/scripts/pilah.mjs +3 -0
  60. package/scripts/release-authorization.mjs +137 -0
  61. package/scripts/review-agent-decisions.mjs +34 -0
  62. package/scripts/semantic-evidence.mjs +15 -0
  63. package/scripts/verifykit.mjs +3 -0
  64. package/skills/pilah/SKILL.md +24 -0
  65. package/src/acceptance-matrix.mjs +84 -0
  66. package/src/browser-evidence.mjs +40 -0
  67. package/src/context-health.mjs +14 -0
  68. package/src/conversations.mjs +302 -0
  69. package/src/engine.mjs +494 -0
  70. package/src/graph.mjs +169 -0
  71. package/src/mcp-diagnostics.mjs +53 -0
  72. package/src/mcp.mjs +151 -0
  73. package/src/model-recovery.mjs +108 -0
  74. package/src/native-tool-recovery.mjs +45 -0
  75. package/src/node-runtime.mjs +13 -0
  76. package/src/orchestration-advisor.mjs +24 -0
  77. package/src/rca.mjs +174 -0
  78. package/src/risk-guidance.mjs +95 -0
  79. package/src/scanner.mjs +303 -0
  80. package/src/security.mjs +793 -0
  81. package/src/semantic-evidence.mjs +144 -0
  82. package/src/skill-discovery.mjs +23 -0
  83. package/src/sqlite-compat.mjs +11 -0
  84. package/src/storage.mjs +455 -0
  85. package/src/tokens.mjs +627 -0
  86. package/src/tools.mjs +164 -0
  87. package/src/verification.mjs +567 -0
  88. package/src/workflow-router.mjs +34 -0
@@ -0,0 +1,52 @@
1
+ # Understanding PILAH token reports
2
+
3
+ ## What the numbers mean
4
+
5
+ PILAH reports in clear, accessible **English by default** so people around the world can read the figures without understanding JSON. **No PILAH install date is required.** The report reads existing Antigravity transcript files locally; conversations created long before the plugin was installed can appear.
6
+
7
+ Three types of values are deliberately separated:
8
+
9
+ 1. **Official Antigravity usage:** `usage.total_tokens` from a CLI JSON result. This is the only field described as confirmed; it applies to the captured run/conversation, not to every older IDE chat. Cache-read and thinking counts are not added again.
10
+ 2. **History from local transcripts:** per-step `input_tokens`, `cache_read_tokens` and `output_tokens` counters. Those fields use an undocumented internal format. PILAH displays two possible interpretations of the totals; neither is labeled an exact bill or a precise Gemini context window.
11
+ 3. **This PILAH report:** its own output size (UTF-8 bytes and a rough character-based token estimate). Running the report from a terminal does **not** call Gemini. If an agent reads the report, the actual additional model usage is only reflected after a model step finishes. PILAH cannot measure tokens of an in-progress model step or separate its exact attributable cost.
12
+
13
+ `PILAH_calls_seen` is based on recognizable calls in transcripts. A zero means no PILAH call was found in the available log, **not** proof that PILAH was uninstalled. No log content is sent to an external server by the reporting code.
14
+
15
+ ## Commands
16
+
17
+ ```bash
18
+ node scripts/pilah.mjs tokens
19
+ node scripts/pilah.mjs tokens --limit 5
20
+ node scripts/pilah.mjs tokens --current
21
+ node scripts/pilah.mjs tokens --conversation <conversation-id>
22
+ node scripts/pilah.mjs tokens --include-subagents
23
+ node scripts/pilah.mjs tokens --json
24
+ node scripts/pilah.mjs tokens --usage-file agy-result.json
25
+ ```
26
+
27
+ Inside the agent, call `pilah_context(action="tokens", history_scope="current")` for the latest session, or explicitly `history_scope="all"` for historical summaries.
28
+
29
+ ## Privacy and coverage
30
+
31
+ - Reads `transcript.jsonl` only, not full reasoning transcripts or artifact contents. Scanning is requested explicitly; no background history import.
32
+ - Subagent records are excluded from the default aggregate because the parent may also include their usage; use `--include-subagents` to inspect them separately. Such combined totals may overlap.
33
+ - Files from an authorized local Antigravity application directory are read in place. No conversation text is saved to PILAH's database.
34
+ - A single transcript is limited to 128 MiB; scans cap at 3,000 conversation directories and 1 GiB of files, reporting any omissions. Results may not be exhaustive when logs are missing, rotated, inaccessible, malformed or truncated.
35
+ - Duplicate `PLANNER_RESPONSE` records with the same numeric `step_index` are deduplicated; official cumulative usage results are not summed as per-step deltas. Imported official exports supersede local estimates for the same conversation.
36
+ - The last session is chosen using PILAH's `SessionStart` marker where available, otherwise the newest transcript mtime. The result is not guaranteed to reflect a model step that is currently still running.
37
+ - Estimates are not bills, and a saving cannot be inferred without comparable native and PILAH runs. For the controlled comparison see [TOKEN_EFFICIENCY.md](TOKEN_EFFICIENCY.md).
38
+
39
+ ## Why there may be a huge token figure
40
+
41
+ Cached context can be read repeatedly over hundreds of model steps, creating a large *cumulative* counter even when the *current* context window is much smaller. Cached reads may already be included within input usage depending on source schema. We therefore show input/cache/output separately, do not combine internal counters with official reports, and do not assign a dollar value from guessed model rates.
42
+
43
+ If a conversation has no readable usage counters, the report says so instead of making up an estimate from source code size.
44
+
45
+ ## Behavioral-audit privacy boundary
46
+
47
+ The user-provided private Antigravity history used for [behavioral analysis](BEHAVIORAL_5_WHYS_V2_0_1.md) contained at least one plaintext login detail; **none of the raw archives or those credentials belongs in this public repository**. This account of past usage is separate from any agent-generated completion evidence. PILAH's optional `save_checkpoint` accepts explicit notes, not entire transcripts, and rejects common credential assignments while always marking them **unverified**. For source-aware recovery see [Checkpoint recovery](CHECKPOINT_RECOVERY.md).
48
+
49
+
50
+ ### MCP call identity (issue #71)
51
+
52
+ Historical `PILAH_calls_seen` counts **observed MCP invocations only**. It recognizes direct eager names (`mcp_pilah_pilah_PILAH_context`), namespaced variants and lazy `call_mcp_tool` with the matching PILAH server/tool pair. A native `pilah tokens` diagnostic command is **not** an MCP intervention and must not inflate adoption. This remains tool-call metadata, not a model-selection or token-savings causal estimate. Additional user sessions must be collected locally and safely to prove actual IDE adoption.
@@ -0,0 +1,68 @@
1
+ # PILAH engineering method — research and adaptation
2
+
3
+ PILAH means **Project Intelligence, Logic, Analysis & Handoffs**. Its mission is to reduce unnecessary code and context while preserving correctness. It is an original, small implementation of general engineering principles, not an installation or fork of another agent plugin.
4
+
5
+ ## Research-based choices
6
+
7
+ | Source | Reusable principle | PILAH behavior | Avoid |
8
+ | --- | --- | --- | --- |
9
+ | [Ponytail](https://github.com/DietrichGebert/ponytail) | Decide whether to write any code; reuse existing, native or installed primitives first; guard risky work | Minimum complete diff and targeted regression test | Copying its plugin, entire prompt or unverified benchmark savings |
10
+ | [Taylor Otwell — Tuple interview](https://podcast.tuple.app/episodes/taylor-otwell-creator-of-laravel/transcript) | Minimal code **that solves the task well**, opinionated/conventional APIs and maintainable backward compatibility | Prefer project conventions; no speculative abstraction; preserve security | Counting lines as the only metric |
11
+ | [Claude Code code-simplifier](https://claude.com/plugins/code-simplifier) | Review only changed code for simplification without behavior changes | Scoped, post-test cleanup | Mandatory extra agent for each trivial edit |
12
+ | [Superpowers](https://github.com/obra/superpowers) | Reproduce/root-cause/test first; RED-GREEN-REFACTOR and reviewed handoffs for hard changes | Adaptive evidence-based RCA and meaningful regression checks | Ritualistic workflows or forced TDD for copy changes |
13
+ | [Claude Code feature architecture](https://claude.com/resources/articles/steering-claude-code-skills-hooks-rules-subagents-and-more) | Rules always-on, skills on demand, deterministic hooks only when justified, subagents for isolated work | Tiny rule, one on-demand skill, four tools, opt-in workers | Importing Claude-only agent/team commands into Antigravity |
14
+ | [Antigravity plugin docs](https://antigravity.google/docs/build-plugins) | Native first, skills loaded on demand, plugin hook/MCP specs, runtime support | Use actual Antigravity plugin manifest, `skills/pilah`, `mcp_config.json` and permission policy | Assuming Claude's hook schemas are interchangeable |
15
+
16
+ ## Claude Code versus Google Antigravity (Nov 2026)
17
+
18
+ | Dimension | Claude Code | Antigravity | PILAH decision |
19
+ | --- | --- | --- | --- |
20
+ | Main workflow | Terminal/IDE coding agent; strong git/CLI workflow | IDE/App/CLI with native agent, subagents, browser and plugin ecosystem | Keep Antigravity as executor |
21
+ | Persistent guidance | `CLAUDE.md`, rules, on-demand skills | Rules `AGENTS.md`, on-demand skills, native plugin bundles | Keep always-on guidance under one short paragraph |
22
+ | MCP and hooks | Broad tool/hook/plugin integration | MCP, plugin hooks, rules and agents with different schemas | Use native Antigravity contracts; no Claude emulation |
23
+ | Parallel agents | Subagents and agent teams available with host controls | Native subagents and workflow/orchestration host features | Opt-in, only independent tasks, no extra orchestrator |
24
+ | Verification | Native terminal, tests, web/browser integrations | Native terminal, browser and IDE acceptance | Treat local tests as local, not independent app proof |
25
+ | Context and cost | Usage varies by model/tool and workflows | Usage varies by model/tier and host context | Never claim PILAH token reductions without matched observed trials |
26
+
27
+ **What not to port:** Claude plugin installation syntax, Claude-only `CLAUDE.md` discovery assumptions, autonomous review subagents on every edit, model-based hooks running on every invocation, or another 10–20 skills. Adding them would increase maintenance and risk rather than simplify PILAH.
28
+
29
+ ## Smallest complete change — decision procedure
30
+
31
+ 1. Inspect goal, existing implementation, callers and authorized workspace.
32
+ 2. Choose **delete/skip → reuse → platform primitive → installed code → minimum new code**.
33
+ 3. Preserve external contracts, test coverage and boundary checks.
34
+ 4. For significant risk, reproduce failure and run the smallest discriminating test before fixing. Re-test the exact affected behavior.
35
+ 5. If still uncertain, make one precise PILAH MCP call. Do not automatically chain tools.
36
+ 6. Finish with a concise proof ledger: changed, verified, not verified, known limits.
37
+
38
+ ## Further 2026 harness research: what PILAH adopts
39
+
40
+ The following sources inform **design decisions**; none proves a percent improvement for PILAH or authorizes automatic modifications.
41
+
42
+ | Evidence | Finding and scope | PILAH decision |
43
+ | --- | --- | --- |
44
+ | [Anthropic Agent Skills](https://www.anthropic.com/research/equipping-agents-for-the-real-world-with-agent-skills) | On-demand filesystem-backed skills use progressive disclosure | Keep one short skill with links to references, no mandatory library of agent personas |
45
+ | [Empirical harness study](https://arxiv.org/abs/2609.20804), [minimal harness comparison](https://arxiv.org/abs/2609.40303) | Bash-capable models can be effective with minimal action surfaces; task/model changes may reverse the result | Permit native short scripts, do not remove the scoped four MCP operations without matched A/B tests |
46
+ | [MCP specification changelog, July 2026](https://github.com/modelcontextprotocol/modelcontextprotocol/blob/main/docs/specification/2026-07-28/changelog.mdx) | OAuth applies to relevant HTTP servers; sampling and observability semantics have changed across protocol revisions | Keep local stdio MCP and workspace trust. No remote OAuth gateway, remote sampling, OTel exporter or daemon until an actual requirement exists |
47
+ | [GEPA optimize_anything](https://arxiv.org/abs/2605.19633) | A benchmark-specific ARC-AGI setup reports Gemini Flash rising from 32.5% to 89.5% through optimized architecture | Use offline human-reviewed instruction ablation with frozen regression tasks, never autonomous production prompt rewrites |
48
+ | [LinkedIn knowledge-graph RAG research](https://arxiv.org/abs/2404.17723) | One deployed support-workflow study reports a 28.6% median ticket resolution-time reduction | Reuse PILAH's local static graph; do not introduce a vector DB, PageRank service or persistent user-profile scoring by default |
49
+ | [Revolut self-hosting case report](https://www.theregister.com/ai-and-ml/2026/11/03/british-fintech-revolut-slashes-ai-coding-costs-10x-by-cutting-out-claude-and-going-self-hosted/) | Revolut reports ~90% lower inference expense from a **large self-hosted model/GPU setup**, not a validated plugin optimization | Do not copy infrastructure economics to a local Antigravity plugin |
50
+ | [Antigravity overview](https://antigravity.google/docs/overview) | Host has its own subagents, schedules, tools and verification | Rely on host-native opt-in capabilities; do not create sidecars or a second orchestration runtime |
51
+
52
+ **Unverified or non-portable:** a universal 2× Bash/MCP ratio, a generic 1M→60k-token code-mode effect, >90% cache hit rate in PILAH, 3× GraphRAG accuracy across codebases, and Humanity's Last Exam gains from reflective memory. These are specific studies, demonstrations, or not independently reproduced here. They are **not acceptance criteria or marketing claims**.
53
+
54
+ ### Lean evaluation loop
55
+
56
+ 1. Fix a representative source snapshot, evaluation rubric, security negatives and success definition.
57
+ 2. Compare native Antigravity and PILAH at matched model, effort, permissions and hardware; counterbalance run order.
58
+ 3. Measure official model tokens where available, wall time, tool failures, successful task completion and **cost per independently accepted task**. Missing provider usage stays `unknown`.
59
+ 4. Make a single versioned change to the skill or tool surface; rerun the same suite plus unseen holdout tasks.
60
+ 5. Reject regression, misleading green tests, invented provenance and lower-cost failures. Require review before merging. **No automatic self-improvement daemon.**
61
+
62
+ See [CI and evaluation](CI_EFFICIENCY.md), [A/B methodology](AB_EVALUATION.md) and [unverified live acceptance](MAIN_VALIDATION_BACKLOG.md).
63
+
64
+ ## Brand and compatibility status
65
+
66
+ The public plugin, skill, MCP server and primary CLI identity are **PILAH**. Its four default tools are `pilah_context`, `pilah_impact`, `pilah_verify` and `pilah_evidence`. Previous tool and CLI aliases remain recognized internally; pre-existing environment settings and local databases are deliberately **not renamed**, so users do not lose their project data. Use [tool definitions](../src/tools.mjs) for exact compatibility symbols rather than inventing configuration names.
67
+
68
+ The repository has not yet been renamed in GitHub settings, and `@aliip/pilah` is only a package manifest identifier until registry publication is confirmed. Live installed Antigravity, independent F01–F18 acceptance and measured Native-versus-PILAH token benefits remain outstanding in the [validation backlog](MAIN_VALIDATION_BACKLOG.md).
@@ -0,0 +1,35 @@
1
+ # PILAH — installed Antigravity acceptance runbook
2
+
3
+ This is a **manual, evidence-based** host acceptance plan. Repository CI and a CLI plugin listing cannot prove an agent loaded the skill, selected the right tool, or completed a coding task.
4
+
5
+ ## Host preflight
6
+
7
+ From the exact checkout:
8
+
9
+ ```sh
10
+ node scripts/pilah.mjs doctor --public
11
+ node scripts/host-check.mjs
12
+ agy plugin validate --strict .
13
+ agy plugin list
14
+ ```
15
+
16
+ Unsupported or missing commands mean **not tested / blocked**, not PASS. The host checker executes only read-only native plugin validation and listing commands (no model runs, network probes or workspace writes). Redact any host logs before sharing. Actual host CLI syntax depends on the installed version; inspect `agy --help` when a command is unsupported.
17
+
18
+ ## Live acceptance scenarios (operator-run)
19
+
20
+ | ID | Given / When / Then | Required proof |
21
+ | --- | --- | --- |
22
+ | H01 | A trivial single-file text edit → agent uses **zero** PILAH tools | Actual session trace and successful local diff |
23
+ | H02 | A source provider with two real consumers → agent chooses scoped `pilah_context` or `pilah_impact` | Trace, returned revision, correct changed/affected paths, no unrelated sibling |
24
+ | H03 | Revoked or protected project → PILAH tool call denied | Host tool error, no private path/content exposed |
25
+ | H04 | A high-risk edit → `pilah_verify` creates a typed plan, still `not_tested` before execution | Plan criteria and revision |
26
+ | H05 | A stale or missing native test report → handoff remains `stale`/`unknown`/`partial` | Original report, run provenance and non-PASS outcome |
27
+ | H06 | A real UI or stateful bug → native terminal/browser test runs, PILAH does not claim independent proof | Test report, actual interactions, source revision and unmet assertions |
28
+
29
+ **Frozen control variables:** same source SHA, Antigravity version, model, effort, permissions and tool availability for Native and PILAH. Evaluate at least five counterbalanced runs per configuration. Keep raw captures private and use `benchmarks/ab-evaluate.mjs` on explicitly supplied final CLI usage. Do not treat its results as independently accepted when `comparability.ready=false`.
30
+
31
+ ## Completion rules
32
+
33
+ A host PASS requires real CLI/IDE test evidence for each scenario, not a generated summary. Record `completed`, `failed`, `partial`, `stale`, `unknown` or `not_tested`; never translate missing observations into PASS. The independent STOCKROOM F01–F18 suite and signed release authorization remain separate gates.
34
+
35
+ **Current status:** all H01–H06 are **not tested** in this repository-only audit. Do not publish or claim measured token savings.
@@ -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/stockroom-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 [trace comparison](AGENT_TRACE_BENCHMARK.md), [token provenance](TOKEN_PROVENANCE.md), and [A/B evaluation](AB_EVALUATION.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. See [A/B methodology](AB_EVALUATION.md).
16
+ 4. **STOCKROOM 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/stockroom-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) and [A/B protocol](AB_EVALUATION.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).
@@ -0,0 +1,14 @@
1
+ # Private Benchmark Report Export
2
+
3
+ The **opt-in**, source-checkout-only exporter from issue #14 minimizes content before manual release of an A/B aggregate. It does **not** upload or publish anything.
4
+
5
+ ```bash
6
+ node benchmarks/ab-evaluate.mjs manifest.json > aggregated.json
7
+ node scripts/export-benchmark.mjs aggregated.json > public-candidate.json
8
+ ```
9
+
10
+ Only supported `<ab-evaluation-schema-id-from-source>` input can be exported. Output uses an explicit allowlist of recognized variant/status metadata and aggregate numeric measures. Setup prompts, paths, logs, conversation text, user IDs, cookies, credentials and source content are not intentionally emitted.
11
+
12
+ **Manually inspect every proposed public artifact anyway.** Redaction is not an authorization to share private Antigravity brain ZIPs, original STOCKROOM application snapshots, customer data or model transcripts. Compare actual native/PILAH quality and usage under controlled trials; an exported aggregate is **not** independent acceptance evidence.
13
+
14
+ Related: [A/B evaluation](AB_EVALUATION.md), [Token efficiency](TOKEN_EFFICIENCY.md), [Security](SECURITY.md), Open release blocker.
package/docs/README.md ADDED
@@ -0,0 +1,58 @@
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
+ - [STOCKROOM 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
+ - [Controlled Native-versus-PILAH evaluation](AB_EVALUATION.md)
35
+ - [Observed MCP intervention logging](INTERVENTION_LEDGER.md)
36
+
37
+ ## Historical implementation audits and research — reference only
38
+
39
+ 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.
40
+
41
+ - [Initial Five Whys review](5-WHYS.md)
42
+ - [Earlier Always-On incident analysis](ALWAYS_ON_5_WHYS.md)
43
+ - [Adaptive RCA design history](ADAPTIVE_RCA_WORKFLOW.md)
44
+ - [Agent decision findings](AGENT_DECISION_REVIEW.md)
45
+ - [Historical agent trace evaluation](AGENT_TRACE_BENCHMARK.md)
46
+ - [v2.0.1 behavioral Five Whys](BEHAVIORAL_5_WHYS_V2_0_1.md)
47
+ - [Engineering standards research](OPEN_SOURCE_ENGINEERING_STANDARDS.md)
48
+ - [Pre-vNext migration and audit](PRE_VNEXT_INTEGRATION.md)
49
+ - [Earlier private-export design](PRIVATE_BENCHMARK_EXPORT.md)
50
+ - [v2.0.1 security audit](SECURITY_RELIABILITY_AUDIT_V2_0_1.md)
51
+ - [Historical research references](SOURCES.md)
52
+ - [Frozen source preflight snapshot](STOCKROOM_BENCHMARK_RECHECK_2026_11_18.md)
53
+ - [Earlier token-efficiency review](TOKEN_EFFICIENCY.md)
54
+ - [v2.0.1 issue/PR provenance](V2_0_1_TRACEABILITY.md)
55
+
56
+ ## Sources of truth
57
+
58
+ 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.
@@ -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 A/B evaluations](AB_EVALUATION.md). 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.**