@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,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
+
@@ -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 STOCKROOM 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) and [Frozen STOCKROOM local rerun](./STOCKROOM_BENCHMARK_RECHECK_2026_11_18.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.
@@ -0,0 +1,27 @@
1
+ # Semantic and Browser Evidence — issue #8
2
+
3
+ PILAH provides read-only local evidence assessment via:
4
+
5
+ - `pilah_verify(operation="assess_semantic",artifact="reports/scenarios.json")`
6
+ - `pilah_verify(operation="assess_browser",artifact="reports/browser.json")`
7
+ - `node scripts/semantic-evidence.mjs reports/scenarios.json` for an offline standalone report
8
+
9
+ `assess_semantic` checks scenario-specific structural observations against the current workspace revision. Supported categories include genuine two-connection overlapping stock checkout, browser process restart with a persistent profile, idempotent response loss with conflicting payload, payment arithmetic, bounded refund/restock, tenant/store entrypoint matrix, invitation and authentication negatives.
10
+
11
+ **Crucially:** a test named `ConcurrentCheckoutTest` or a JSON `witnessed_capabilities` list never proves parallel execution. The evaluator computes capabilities from structured facts. All facts are still **unattested** caller input; results can only be `evidence-present-unattested`, `insufficient-evidence` or `stale`, never independently verified release approval.
12
+
13
+ The browser contract is `<browser-evidence-schema-id-from-source>`. It requires a scenario ID, source fingerprint, build artifact SHA-256, claimed served build hash, browser version, runner version, timestamps, executed assertions, and optional hashed local artifact references. PILAH recomputes referenced artifact file hashes locally using workspace-safety rules. A matching pair of digest strings is **not** proof that the expected build was served; external harness/CI review remains necessary. Screenshots by themselves are not functional assertions.
14
+
15
+ The 18 predefined negative-control cases from STOCKROOM are listed in `tests/fixtures/stockroom-acceptance-18.json`. They are **frozen acceptance specifications**, not completed independent browser/PHP E2E results. Backend isolation, payment and exactly-once invariants still require independently executed test runners.
16
+
17
+ PILAH does not control Chrome, install dependencies, run arbitrary project commands or bypass approvals.
18
+
19
+ ## Source revision and evidence separation
20
+
21
+ Place generated PILAH JSON reports under a `reports/`, `report/`, or `test-results/` directory in the authorized workspace. Only recognized PILAH evidence structures in those directories are excluded from the application-source fingerprint; ordinary JSON source/config files remain indexed and revision-bound. This avoids a circular report: a generated report may contain the revision it is attesting without changing that revision by its own presence.
22
+
23
+ The report bytes remain separately hashed and any later edits invalidate recorded artifact integrity. Application source changes still invalidate report revision matching. This exclusion is only bookkeeping; report content remains **unattested** and never becomes independent release proof.
24
+
25
+ ## Behavioral acceptance contract (merged PR #36)
26
+
27
+ Use `pilah_verify(operation="plan")` with typed Given/When/Then criteria *before* native execution. For browser and visual work, specify the exact viewport, interactive state and design/reference target; every scenario begins **not_tested**. A screenshot or passing local test named after the scenario does not authenticate that the native browser ran the specified interaction. `pilah_verify(operation="assess")` explicitly returns `completion.fully_verified:false` for ordinary reports. These structural inspectors remain separate from independently signed release assessment and the full STOCKROOM external acceptance tracked in issue #15.
@@ -0,0 +1,13 @@
1
+ # Primary sources (reviewed 16 November 2026)
2
+
3
+ - Google Antigravity, Build Plugins: https://antigravity.google/docs/build-plugins/
4
+ - Google Antigravity, MCP: https://antigravity.google/docs/mcp/
5
+ - Google Antigravity, Hooks: https://antigravity.google/docs/hooks
6
+ - Google Antigravity, IDE Browser: https://antigravity.google/docs/ide/browser/
7
+ - Google Antigravity, Permissions: https://antigravity.google/docs/permissions/
8
+ - Google SRE, Effective Troubleshooting: https://sre.google/sre-book/effective-troubleshooting/
9
+ - Lauren Tan, pstack: https://github.com/cursor/plugins/tree/main/pstack
10
+
11
+ Source-derived decisions: the plugin manifest fields and `mcp_config.json` name, `${PLUGIN_ROOT}`/`PLUGIN_DATA`, `agy plugin validate`, Node-based local stdio MCP, and lazy-loaded tool definitions. PILAH's graph algorithm, security controls, data schema and evidence model are **original design decisions**, not features claimed to be natively provided by Google.
12
+
13
+ **Provenance note:** This list records external research sources reviewed at the date in the heading; links, API terms, release availability and entitlement rules may change. It does **not** mean external code, plugins, agents or MCP servers were installed. The source of truth for current PILAH behavior is [the local executable contract](CONTRACTS.md), the [architecture](ARCHITECTURE.md) and CI evidence. External Antigravity integration remains unverified for this candidate.
@@ -0,0 +1,53 @@
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
+ # Frozen STOCKROOM benchmark — independent local rerun
4
+
5
+ **Date:** 18 November 2026.
6
+ **Repository target:** `v2.0.1`.
7
+ **Source archives:** User-owned private Library ZIPs. This is an independent **environment/build preflight**, not F01–F18 execution evidence.
8
+
9
+ ## Reproducible archive identity
10
+
11
+ | Private archive | SHA-256 |
12
+ | --- | --- |
13
+ | `stockroom-native(2).zip` | `b0add01495d7f3f763d08383de78bb6b49ba99937823309e20bb24ca17ef64f4` |
14
+ | `stockroom-pilah(1).zip` | `b69d9bd6e9245afdb918ca150fff6bcf0971cb59f06f127572db8bf9e099c48e` |
15
+ | `brain-native(2).zip` | `c51ec921268df83e643686d542966d88e77e298c8b26208e503d1a615fa5f1a4` |
16
+ | `Brain-PILAH(1).zip` | `e1235269992c7b87227b71dac660c71aeb591ce5881ca612c99bb97719907ef9` |
17
+
18
+ The four originals were not modified. The two app archives were extracted only into disposable, private copies with path traversal and ZIP symlinks skipped. Extracted executable bit normalization was required to run the existing esbuild binary.
19
+
20
+ ## Observed executable checks
21
+
22
+ | Check | Native copy | PILAH-generated copy |
23
+ | --- | --- | --- |
24
+ | PHP `php -l` on app, routes, migrations and tests | **82/82 syntax checks passed** | **61/61 syntax checks passed** |
25
+ | Frontend Vite production build | **PASSED**, 665 modules transformed | **PASSED** |
26
+ | PHPUnit/Laravel integration test | **BLOCKED at test startup** | **BLOCKED at test startup** |
27
+ | Independent F01–F18 live HTTP/browser/database validation | **NOT RUN** | **NOT RUN** |
28
+
29
+ Environment: PHP CLI 8.4.24, Node 22.16.0, Chromium binary present. PHPUnit could not start because PHP `dom`, `mbstring`, and `xmlwriter` extensions were missing. The environment did not expose an installed `agy` command. An attempt to refresh apt repositories timed out; tests requiring the missing PHP runtime were not silently counted as passed or failed application assertions.
30
+
31
+ Commands executed on disposable copies, not the original ZIPs:
32
+
33
+ ```bash
34
+ find app routes database/migrations tests -type f -name '*.php' -print0 | xargs -0 -n1 php -l
35
+ node node_modules/vite/bin/vite.js build
36
+ php artisan test --stop-on-failure
37
+ ```
38
+
39
+ **Interpretation:** both apps have parseable PHP code and buildable frontend assets under this toolchain. This says nothing about last-stock transaction safety, refund correctness, offline cache isolation, role enforcement, error sanitization or end-to-end browser recovery. These remain externally unverified. The original test suite did not produce independent passes because the PHP test runner did not start.
40
+
41
+ ## Remaining required acceptance
42
+
43
+ All 18 scenarios in `tests/fixtures/stockroom-acceptance-18.json` remain **not-tested** in this rerun.
44
+
45
+ Execution still requires isolated Laravel PHP with PDO SQLite and DOM/mbstring/XMLWriter, a real backend and database per application, clean browser profiles and controlled full browser restart, and an independent assessor controlling scenario definitions and signing keys. F08/F09 require **two actual overlapping DB connections**. F10/F11 require complete browser process termination and profile restore; navigating or reloading a tab does not count.
46
+
47
+ The reproducible, frozen source archives are available to the user in their private Library and were intentionally **not committed** to `the existing repository`. Do not put their `.env`, logs, browser profiles, customer data or session archives into a public GitHub release.
48
+
49
+ This report is not release acceptance. The release gate remains blocked until independent live evidence and controlled repeated benchmark trials are available.
50
+
51
+ ## Later PILAH implementation does not retroactively change this baseline
52
+
53
+ Behavioral PR #36 later merged to `v2.0.1` with 213/213 **PILAH Node tests**, including local MCP stdio/SQLite E2E. Those tests are **not reruns of these frozen Laravel applications**. The PHP extension blocker and missing independent F01–F18 browser/database execution remain unchanged. Do not relabel the private STOCKROOM negative controls as passing just because PILAH CI succeeded. See release issue #15.
@@ -0,0 +1,71 @@
1
+ # Token measurement and A/B protocol
2
+
3
+ ## Past and current conversations
4
+
5
+ `pilah tokens` now scans available `~/.gemini/antigravity*/brain/<conversation-id>/.system_generated/logs/transcript.jsonl` entries, including sessions from before PILAH existed. It reports each conversation's recent completed model-step counters and totals recorded locally. Model-step counters may not match official usage accounting; two interpretations (cache included/excluded from input) are displayed, **never treated as a confirmed bill**. Imported official CLI JSON supersedes the same conversation's local counters instead of being added twice.
6
+
7
+ The report itself includes a size estimate for its printed response; **printing it in a terminal makes no Gemini model call**. When the agent reads the report, a subsequent completed model turn is needed before that consumption can appear in Antigravity's logs.
8
+
9
+ For performance, `pilah_context(action="tokens")` defaults to the latest available conversation; specify `history_scope="all"` explicitly to include other conversations. Historical scanning is local and read-only; model prompts are parsed only for usage metadata, not stored anew.
10
+
11
+ For explanation of coverage, privacy, limits and accuracy, see [CONVERSATION_USAGE.md](CONVERSATION_USAGE.md).
12
+
13
+ ## What PILAH can and cannot measure
14
+
15
+ **Without a provider usage record:** `pilah tokens` reports only an **estimated workspace source inventory** and **estimated tool payload sizes**. These numbers are **not** consumed context, billable tokens, savings, or the Gemini context window. Net savings, percentages, and USD estimates are intentionally `null`. Existing legacy telemetry rows cannot retroactively prove savings.
16
+
17
+ **With official Antigravity CLI usage:** `agy --output-format json` provides a run-level `usage` object; `stream-json` provides it in the final `event: result`. PILAH validates and displays the official `total_tokens` without summing cache-read or thinking tokens a second time.
18
+
19
+ ```bash
20
+ # Only runs a new headless Antigravity task; it does NOT measure an existing IDE conversation.
21
+ agy -p "Explain this module without changing files" --output-format json > agy-result.json
22
+
23
+ # Show the official usage for that completed run plus the separate workspace inventory.
24
+ node scripts/pilah.mjs tokens . --usage-file agy-result.json
25
+ ```
26
+
27
+ The imported file may contain conversation content. Keep it local and private; do not commit it. Files over 4 MiB and inconsistent usage totals are rejected. PILAH does not automatically read arbitrary other conversations.
28
+
29
+ ## Source of truth
30
+
31
+ Google's [official CLI headless documentation](https://antigravity.google/docs/cli/headless/) defines the `usage` object. For its example, `input_tokens=10,418`, `output_tokens=589`, and `total_tokens=11,007`. `thinking_tokens=551` and `cache_read_tokens=8,113` are reported fields; neither is separately added to `total_tokens`.
32
+
33
+ Source inventory is estimated from UTF-8 file sizes, not from the live Gemini tokenizer. PILAH cannot directly inspect a model's private context or billing records.
34
+
35
+ ## Controlled A/B procedure
36
+
37
+ 1. Choose at least five tasks with measurable acceptance criteria: trivial edit, regression fix, multi-module change, security fix, and verification/report task.
38
+ 2. Pin repository snapshot, model, Antigravity version, instruction effort, permissions, OS and prompt. Use fresh sessions to prevent prior turns from leaking into the comparison.
39
+ 3. Run from equivalent snapshots in each mode: **Native** (plugin disabled), **On-Demand**, and **Always-On**. Randomize order and repeat each variant multiple times.
40
+ 4. Capture the official CLI JSON result for every run. Use `usage.total_tokens` consistently as the per-run reported metric; separately report `cache_read_tokens`, `thinking_tokens`, `duration_seconds`, number of turns, tool calls and retries.
41
+ 5. Record acceptance-test outcome, regression count and human-review errors. A lower token total with broken behavior is not an improvement.
42
+ 6. Report median and spread by task type. Keep sources/configuration reproducible, and never confuse tool payload counters with provider usage.
43
+
44
+ For matched runs, define `net_difference_pct = 100 * (total_tokens_PILAH - total_tokens_native)/total_tokens_native`. Positive values mean more reported tokens; negative values mean fewer. PILAH cannot calculate this without **both** runs.
45
+
46
+ Do not publish token-savings percentages, cache savings, or 0% false-positive completion until independently verified end-to-end.
47
+
48
+ ## Behavioral-audit interpretation (18 November 2026)
49
+
50
+ The private Antigravity history showed repeated reads of the same path in a session, but these reads may be justified after edits. The value **does not measure wasted tokens** or establish net PILAH savings. Checkpoint/acceptance changes from PR #36 are intended to reduce repeated, ungrounded exploration and overclaims, but the effect requires actual matched A/B experiments, not documentation or microbenchmarks. The release blocker remains #15.
51
+
52
+ ## Low-token skill and MCP budgets — 19 November 2026
53
+
54
+ Issue #44 addresses unnecessary instruction/context overhead on the `v2.0.1` development branch. The policy is **zero calls for trivial work; normally one targeted query OR bounded impact summary**; subsequent calls require new uncertainty or actual machine evidence. The skill no longer carries repeated CLI lists, chronological security incidents or release history.
55
+
56
+ | Static text surface | Before | Revised | Scope |
57
+ | --- | ---: | ---: | --- |
58
+ | `skills/pilah/SKILL.md` | 5,658 characters | 2,792 characters | **51%** less text if the complete skill is loaded |
59
+ | `rules/AGENTS.md` | 382 | 241 characters | Tiny permanent instruction |
60
+ | Always-On `SessionStart` message | 622 | 324 characters | Injected only when opt-in; zero on default On-Demand |
61
+
62
+ **Combined static character footprint:** 6,662 → 3,357 (**49.6% lower**), equivalent to roughly 1,753 → 883 local **chars/3.8 estimates**, *not* live Gemini billed tokens or cumulative session usage. Actual injection behavior depends on the installed IDE and which prompt surfaces are loaded. Do not add these numbers to provider usage or call them net savings.
63
+
64
+ **MCP output limits in default Compact (new installations):**
65
+
66
+ - `pilah_context(action="skeleton")`: 4,800 total skeleton characters; max 1,600 per file; up to six file previews, remaining entries marked `skipped: true`. Keep source revision, omitted/truncated counts and `estimated_preview_only`.
67
+ - `pilah_context(action="query",limit=5)`: prefer an exact symbol. In Compact, at most twelve relation rows. If clipped, `relations_truncated:true` and `relations_before_compaction` describe **the retrieved query response**, not the entire graph.
68
+ - `pilah_impact(summary=true)`: bounded eight affected paths and five related tests with risk, coverage and uncertainty preserved. This pre-existing summary remains the preferred impact call.
69
+ - Full outputs remain available via **explicit** `node scripts/pilah.mjs compact off`; existing explicit settings are preserved. Do not infer correctness from truncated previews.
70
+
71
+ **Quality gates:** automated tests enforce character budgets, default On-Demand injection neutrality, default Compact behavior, skeleton omission disclosure, relation trimming and non-fabricated token estimates. These tests measure **local output sizes only**. To prove usage benefit, run matched Native vs PILAH model/effort/tasks with official provider usage and independent acceptance; F01–F18 and real installed Antigravity validation remain in issue #15.
@@ -0,0 +1,15 @@
1
+ # Token history: provenance and worker overlap (#5)
2
+
3
+ PILAH reports available Antigravity conversation usage including pre-install history. The report now includes `usage_accounting` for explicit source priority, excluded/included workers, missing records, attributable PILAH token *unknowns*, and unsupported weekly quota measurements.
4
+
5
+ **Do not sum parent and worker counters** when `--include-subagents` is requested: a parent result may already contain delegated usage. The optional view shows additional conversations for inspection, not a provider-confirmed combined bill. `detected plugin-call count` is a count of recognized tool calls, not an exact measure of model tokens caused by PILAH.
6
+
7
+ Official CLI `usage.total_tokens` already equals `input_tokens + output_tokens`; cache-read and thinking are separate diagnostics, not values added to official totals. Local transcript counters have undocumented semantics. No automatic collection, publication or background scanning is introduced.
8
+
9
+ Official source: https://antigravity.google/docs/cli/headless/ ; quota limitations: https://antigravity.google/docs/plans . See also `docs/CONVERSATION_USAGE.md`.
10
+
11
+ The future benchmark must validate worker inclusion and exact plugin overhead against independent provider instrumentation where available; a zero or invented savings percentage is not acceptable.
12
+
13
+ ## Current developer status
14
+
15
+ The PR #36 behavioral work added recovery and evidence scopes but **did not** add a provider usage API or promise token savings. Local MCP/SQLite E2E is not a controlled Native/PILAH model-token benchmark. See [evaluation](AB_EVALUATION.md) and open acceptance.
@@ -0,0 +1,66 @@
1
+ > **Historical implementation record:** Naming is standardized to PILAH for current documentation; the recorded branch, test results and decisions remain historical rather than claims about present release readiness.
2
+
3
+ # v2.0.1 Integration Traceability and Promotion Gate
4
+
5
+ > **State:** Integrated into `v2.0.1` only; **NOT released**, not benchmark-validated, not merged into `main`.
6
+
7
+ ## Source and immutable baseline
8
+
9
+ - Repository: the existing repository.
10
+ - Previous baseline: `main` at `b622110d0feabf469390a41f3c93338053b3c7b6`. Preserve it for the benchmark.
11
+ - Version branch: `v2.0.1`.
12
+ - Combined source integration: PR #29, **merged to `v2.0.1` only**.
13
+ - Integration merge commit: `049a5297fbd4c542918f4a23e9676d5e2b0530ce`.
14
+ - Both `package.json` and `plugin.json` declare `2.0.1`. No npm publication, GitHub release, or release tag is implied.
15
+ - Historical cross-platform CI after the 12 original feature merges at `1da0c8ff5ecec83a1000e8e57cbeb941fcdc870e` (not the current candidate head): GitHub Actions run #44248690103. GitHub Actions tested Ubuntu Node 22/24, Windows Node 22, macOS Node 22.
16
+ - All feature PRs #16–#27 are now **individually Merged into `v2.0.1`**, after their implementation was reconciled and integrated by PR #29. Conflicting feature branches were recorded using Git two-parent merge commits retaining the reviewed combined tree (`83dfa3a653056595b31032584079f613a0b8ec6e`), so there were **no duplicate code changes**. Implementation issues #3–#14 are closed; independent validation remains open in #15.
17
+
18
+ ## Original PR → integration traceability
19
+
20
+ | Issue | Original PR (Merged to v2.0.1) | Scope incorporated into PR #29 |
21
+ | --- | --- | --- |
22
+ | #3 | #16 | Reproducible A/B evaluator, conservative official usage and repeated-run checks |
23
+ | #4 | #17 | Signed independent acceptance gate, user-pinned frozen acceptance registry |
24
+ | #5 | #18 | Historical token provenance and worker overlap limitations |
25
+ | #6 | #19 | Privacy-safe MCP error diagnostics and authorization recovery |
26
+ | #7 | #20 | Static impact coverage uncertainty and bounded test candidates |
27
+ | #8 | #21 | Semantic negative controls, browser evidence, 18-case STOCKROOM acceptance **specification** |
28
+ | #9 | #22 | Interrupted run and verification checkpoint recovery |
29
+ | #10 | #23 | Risk-driven financial, inventory, authorization, offline verification prompts |
30
+ | #11 | #24 | Native Teamwork/Swarm/subagent advisor requiring user consent |
31
+ | #12 | #25 | Observable agent trace comparison and independent decision-review metadata |
32
+ | #13 | #26 | PILAH intervention ledger without causal claims |
33
+ | #14 | #27 | Opt-in, privacy-limited benchmark report export |
34
+
35
+ **Important integration detail:** #17, #21 and #24 modified `src/engine.mjs`, `src/tools.mjs`, and generated MCP schemas; #17 and #23 modified `src/verification.mjs`. Their handlers/contracts were manually reconciled into PR #29 and validated together. Therefore, the source of truth for the combined version is **the `v2.0.1` branch**, not any individual PR head.
36
+
37
+ ## Promotion requirements: v2.0.1 → main
38
+
39
+ All conditions below must be independently verified before preparing the final pull request:
40
+
41
+ - [ ] All 18 frozen STOCKROOM scenarios (F01–F18) executed against isolated *running applications* with real HTTP/browser/backend/database assertions. The checked-in scenario JSON is a specification, not passing evidence.
42
+ - [ ] Separate evaluator-controlled scenario registry, pinned signing keys, artifact provenance and build/source freshness verified; unauthorized or missing evidence fails closed.
43
+ - [ ] Real Antigravity installation and MCP smoke tests completed using the `v2.0.1` branch, with workspace permissions and browser behavior confirmed.
44
+ - [ ] Controlled A/B benchmark completed against frozen `main` and Native using comparable models, prompts, environments, repeated runs, official usage where available, and independent acceptance results.
45
+ - [ ] Privacy and negative-control review completed; no high-severity regression remains.
46
+ - [ ] Final `v2.0.1` commit passes combined CI and release contract checks.
47
+ - [ ] **Explicit human approval** to promote the version branch to `main`.
48
+
49
+ Only after those gates pass, **create one PR with base `main` and head `v2.0.1`**. Do not merge, tag, publish to npm, or create a GitHub Release automatically. The twelve original feature PRs have already been individually merged to `v2.0.1`; implementation issues #3–#14 are closed with unverified external acceptance consolidated into open tracking issue #15. Do not merge these features again.
50
+
51
+ See [Release Engineering](./RELEASE.md) and [Independent Acceptance Runbook](./INDEPENDENT_ACCEPTANCE_RUNBOOK.md).
52
+
53
+ ## Current decision
54
+
55
+ **Feature integration: all 12 original feature PRs and behavioral PR #36 merged into `v2.0.1`.** **Cross-platform CI: passed at the current documented behavioral merge commit.** **Independent live acceptance/benchmark: not completed.** **Promotion to main: blocked until approval and evidence.**
56
+
57
+ ## Behavioral reliability merge and latest audited implementation (18 November 2026)
58
+
59
+ - Behavioral audit implementation: PR #36 **merged into `v2.0.1`**, squash commit `67ea5888caf61751952c8a7daa1eb222d738d4b6`.
60
+ - Six code-level issues **closed**: #30 truthful completion and structured criteria; #31 UI state and Figma/browser acceptance; #32 tool recovery; #33 source-fresh decision checkpoints; #34 independent-file-ownership teamwork; #35 private transcript hygiene and MCP E2E.
61
+ - Post-merge Actions run 44325007116: **success 4/4** (Ubuntu Node 22/24, macOS Node 22, Windows Node 22); Ubuntu Node 22: **213/213 passed**.
62
+ - Exactly four public MCP tools remain; Node runtime package dependencies unchanged. Two branches remained after merge: `main` and `v2.0.1`.
63
+ - `main` baseline at the time of this audit: `b622110d0feabf469390a41f3c93338053b3c7b6`. **No promotion, tag, npm candidate publish, or GitHub Release.**
64
+ - Closing implementation issues is **not** the same as independent acceptance. #15 remains the sole external release blocker: native installed Antigravity, frozen real F01–F18, repeated benchmark, independent signing and explicit release approval.
65
+
66
+ See [behavioral Five Whys](BEHAVIORAL_5_WHYS_V2_0_1.md), [current contracts](CONTRACTS.md), [docs index](README.md).
package/hooks.json ADDED
@@ -0,0 +1,45 @@
1
+ {
2
+ "pilah-session-telemetry": {
3
+ "SessionStart": [
4
+ {
5
+ "type": "command",
6
+ "command": "node ./scripts/hook.mjs",
7
+ "timeout": 5
8
+ }
9
+ ],
10
+ "PostToolUse": [
11
+ {
12
+ "matcher": "run_command",
13
+ "hooks": [
14
+ {
15
+ "type": "command",
16
+ "command": "node ./scripts/hook.mjs",
17
+ "timeout": 5
18
+ }
19
+ ]
20
+ },
21
+ {
22
+ "matcher": "write_file|edit_file|write_to_file|replace_file_content|multi_replace_file_content",
23
+ "hooks": [
24
+ {
25
+ "type": "command",
26
+ "command": "node ./scripts/hook.mjs",
27
+ "timeout": 5
28
+ }
29
+ ]
30
+ }
31
+ ],
32
+ "PreToolUse": [
33
+ {
34
+ "matcher": "run_command",
35
+ "hooks": [
36
+ {
37
+ "type": "command",
38
+ "command": "node ./scripts/hook.mjs",
39
+ "timeout": 5
40
+ }
41
+ ]
42
+ }
43
+ ]
44
+ }
45
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "mcpServers": {
3
+ "pilah": {
4
+ "command": "node",
5
+ "args": [
6
+ "${PLUGIN_ROOT}/src/mcp.mjs"
7
+ ],
8
+ "timeoutSeconds": 90,
9
+ "tools": {
10
+ "pilah_context": {
11
+ "eager": true
12
+ }
13
+ }
14
+ }
15
+ }
16
+ }
package/package.json CHANGED
@@ -1,6 +1,33 @@
1
1
  {
2
2
  "name": "@aliip/pilah",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "PILAH (Project Intelligence, Logic, Analysis & Handoffs): native-first engineering context, minimal-change guidance and evidence-scoped verification for Google Antigravity.",
5
+ "type": "module",
6
+ "main": "src/engine.mjs",
7
+ "bin": {
8
+ "pilah": "scripts/pilah.mjs",
9
+ "a2a": "scripts/a2a.mjs"
10
+ },
11
+ "publishConfig": {
12
+ "access": "public"
13
+ },
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/alifakbxr/pilah.git"
17
+ },
18
+ "bugs": {
19
+ "url": "https://github.com/alifakbxr/pilah/issues"
20
+ },
21
+ "homepage": "https://github.com/alifakbxr/pilah#readme",
22
+ "license": "MIT",
23
+ "engines": {
24
+ "node": ">=22.13.0"
25
+ },
26
+ "scripts": {
27
+ "test": "node --test tests/*.test.mjs",
28
+ "check": "npm run syntax && npm test",
29
+ "selftest": "node scripts/pilah.mjs doctor",
30
+ "benchmark": "node benchmarks/bench.mjs",
31
+ "syntax": "node scripts/check-syntax.mjs"
32
+ }
33
+ }
package/plugin.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "$schema": "https://antigravity.google/schemas/v1/plugin.json",
3
+ "name": "pilah",
4
+ "displayName": "PILAH",
5
+ "version": "1.0.0",
6
+ "description": "PILAH (Project Intelligence, Logic, Analysis & Handoffs): native-first engineering context, minimal-change guidance and evidence-scoped verification for Google Antigravity.",
7
+ "logo": "assets/logo.svg",
8
+ "author": {
9
+ "name": "Alif Akbar"
10
+ },
11
+ "license": "MIT",
12
+ "repository": "https://github.com/alifakbxr/pilah",
13
+ "keywords": [
14
+ "pilah",
15
+ "engineering",
16
+ "native-first",
17
+ "minimal-code",
18
+ "verification",
19
+ "context",
20
+ "token-awareness"
21
+ ],
22
+ "suggestedPrompts": [
23
+ "/pilah - Native-first code intelligence and minimal-change workflow",
24
+ "Ask PILAH for a scoped impact analysis before a risky edit",
25
+ "Review a fix using an evidence-based test plan"
26
+ ]
27
+ }
@@ -0,0 +1,2 @@
1
+ # PILAH
2
+ Native first: zero calls for clear tasks. Reuse code and platform primitives. For unclear cross-file risk, one scoped MCP call. Reproduce, test, simplify. Preserve security and compatibility. No automatic agents, compaction or token claims.