pyric-admin 0.1.0-alpha.8 → 0.1.0-alpha.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,216 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
203
+
204
+ Copyright 2026 David East
205
+
206
+ Licensed under the Apache License, Version 2.0 (the "License");
207
+ you may not use this file except in compliance with the License.
208
+ You may obtain a copy of the License at
209
+
210
+ http://www.apache.org/licenses/LICENSE-2.0
211
+
212
+ Unless required by applicable law or agreed to in writing, software
213
+ distributed under the License is distributed on an "AS IS" BASIS,
214
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
215
+ See the License for the specific language governing permissions and
216
+ limitations under the License.
package/README.md CHANGED
@@ -2,138 +2,155 @@
2
2
  <img src="https://pyric.dev/pyric-logo.svg" alt="Pyric" width="180" />
3
3
  </p>
4
4
 
5
- <h1 align="center">Firebase that runs in the browser</h1>
5
+ <h1 align="center">Build with Firebase without touching production</h1>
6
6
 
7
- <p align="center">Agentic coding without production consequences</p>
7
+ <p align="center">Keep the same <code>firebase/*</code> code. Pyric runs it against a local backend during development, then gets out of the way when the app ships to Firebase.</p>
8
8
 
9
9
  <p align="center"><a href="https://pyric.dev">pyric.dev</a></p>
10
10
 
11
11
  <br />
12
12
 
13
- Pyric is Firestore, Auth, Realtime Database, Storage, *Messaging soon*, and the Security Rules engine, implemented in TypeScript and running inside the application process. In the browser, that process is the page itself: the whole backend executes in the tab. In Node, it is the Node process, so tests and scripts get the same backend with no browser involved.
13
+ Pyric adds a development-only resolution layer to a Firebase application. Run the Vite development server and supported Firebase imports resolve to a browser-local backend. Run a normal production build and those imports resolve to Firebase again. The application source does not branch between the two.
14
14
 
15
- ## Built for dev, disappears in prod
16
- This is not the Firebase Emulator Suite behind a wrapper. There is no Java process, no localhost port, and no cloud Firebase project connected.
15
+ The mirrored data services do not connect to a production Firebase project. Local writes cannot delete production data or create Firebase usage charges, and local rules changes do not deploy. Pyric owns the development sandbox and verification workflow. Firebase owns production, with `firebase-tools` or the Firebase Console handling deployment.
17
16
 
18
- Application code keeps using `firebase/*` imports which are mapped to the sandbox during development. When you ship to production, the map goes away, and the app talks to production services.
17
+ ## Start a new Firebase application locally
19
18
 
20
- Pyric's tooling maps one-to-one to standard Firebase tools.
19
+ Create a Vite application with canonical Firebase imports, Firestore rules, and the Pyric development plugin already configured:
21
20
 
22
21
  ```bash
23
- npm i pyric === npm i firebase
24
- npm i pyric-admin === npm i firebase-admin
25
- npm i pyric-tools === npm i firebase-tools
22
+ npx create-pyric my-app
23
+ cd my-app
24
+ npm install
25
+ npm run dev
26
26
  ```
27
27
 
28
- The pyric CLI, `pyric-tools`, is for managing the pyric environment and not meant to overlap with the utility of the Firebase CLI, `firebase-tools`. The small overlap `pyric login`, `pyric deploy`, is an extreme subset of the Firebase CLI's functionality and offered for convenience.
28
+ `npm create pyric my-app` runs the same scaffold.
29
29
 
30
- ### Backed by conformance
31
- The services are an independent implementation of Firebase's observable behavior, and that claim is tested rather than assumed: probes run against production Firebase, their recorded behavior is committed as observations, and CI replays every observation against the sandbox on every change. The section [What matches Firebase and what doesn't](#what-matches-firebase-and-what-doesnt) has the numbers.
30
+ ## Run an existing Firebase application locally
32
31
 
33
- Because the services live in the process, the backend becomes local state. Data, identities, security rules, and time-ordered events can be seeded, snapshotted, reset, and replayed the way source code is edited.
32
+ Install the development plugin:
34
33
 
35
- ## Where a coding agent runs Firebase code
36
- Agents already know the Firebase SDK. They don't need a new API to learn, they need somewhere to run the code they already write. Pyric is that target: the same `firebase/*` calls, executed against a local sandbox instead of production. On the map of an agent's tools it doesn't sit beside Firebase as an alternative, it sits under the code the agent already generates, as the thing that code runs against during development. Because the sandbox is fully local, there is no Firebase project and no account in the loop.
34
+ ```bash
35
+ npm install --save-dev @pyric/cli
36
+ ```
37
37
 
38
- Traditionally, Firebase development begins with an account, a project, enabled services, the Emulator Suite and its Java dependency, and hand-wired switching between emulator and production in the SDK. An agent working in that environment touches real infrastructure, so writes, deploys, and rules changes need supervision.
38
+ Add it to the existing Vite configuration:
39
39
 
40
- A backend that runs inside the app removes the infrastructure from the loop. A developer gets a full Firebase stack in the first ten seconds of a project. An agent gets the whole backend as an inspectable, resettable tool surface it can exercise without supervision.
40
+ ```ts
41
+ // vite.config.ts
42
+ import { defineConfig } from 'vite';
43
+ import { pyricSandbox } from '@pyric/cli/vite';
41
44
 
42
- ## Getting Started
45
+ export default defineConfig({
46
+ plugins: [pyricSandbox()],
47
+ });
48
+ ```
43
49
 
44
- Install the CLI in an existing Firebase app or a new one:
50
+ Start the normal development server:
45
51
 
46
52
  ```bash
47
- npm i -g pyric-tools # installs the `pyric` command
48
- npx pyric init --template web # scaffold, or just run pyric dev in an existing app
49
- npx pyric dev
53
+ npm run dev
50
54
  ```
51
55
 
52
- `pyric dev` serves the app against the in-process sandbox. The app's own `firebase/*` imports resolve to the sandbox during development; nothing in the application source changes. The sandbox holds data, identities, and rules, and everything it does is observable through the mechanisms below.
56
+ During `vite dev`, the plugin swaps supported `firebase/*` modules at resolution time. The backend runs in a SharedWorker, so tabs on the same development origin use one local backend. Browser-local persistence uses IndexedDB.
53
57
 
54
- ## Security rules as a library
58
+ Pyric Studio is available on the Vite origin at `/__pyric/ui/`. It opens the same backend used by the application.
55
59
 
56
- Pyric includes a rules engine for Firestore and Realtime Database rules: parser, linter, validator, and simulator, usable in-process and from the CLI.
60
+ For a static application or a Node process, `pyric dev` provides the same development-only package swap without the Vite plugin. The [CLI reference](packages/cli/docs/reference/cli.md) documents those paths and every command.
57
61
 
58
- ```bash
59
- pyric rules:lint firestore.rules
60
- pyric rules:simulate --stdin
61
- pyric database:rules:validate database.rules.json
62
+ ## Keep writing Firebase code
63
+
64
+ Application code continues to import Firebase:
65
+
66
+ ```ts
67
+ // src/firebase.ts
68
+ import { initializeApp } from 'firebase/app';
69
+ import { getAuth } from 'firebase/auth';
70
+ import { getFirestore } from 'firebase/firestore';
71
+
72
+ const app = initializeApp({
73
+ apiKey: import.meta.env.VITE_FIREBASE_API_KEY,
74
+ authDomain: import.meta.env.VITE_FIREBASE_AUTH_DOMAIN,
75
+ projectId: import.meta.env.VITE_FIREBASE_PROJECT_ID,
76
+ });
77
+
78
+ export const auth = getAuth(app);
79
+ export const db = getFirestore(app);
62
80
  ```
63
81
 
64
- Rules edits take effect in the running app without a deploy. Realtime Database `.validate` rules are evaluated on writes, matching production behavior.
82
+ The Firebase configuration is accepted by the local mirror during development. The production build passes that same configuration to Firebase. Normal Auth, Firestore, Realtime Database, Storage, Messaging, and Firebase AI Logic usage still belongs in the [Firebase documentation](https://firebase.google.com/docs).
65
83
 
66
- ## Everything the sandbox does is an event
84
+ Pyric documents the parts that differ locally, including supported behavior, Security Rules, persistence, inspection, verification, and known gaps. See [use the Vite plugin](packages/cli/docs/how-to/use-the-vite-plugin.md) for the complete plugin contract.
67
85
 
68
- The sandbox emits a typed event for every operation it performs: reads, writes, auth transitions, and rules verdicts, including denials with the rule, path, and data that produced them. The diagnostics are consumers of that stream:
86
+ ## Inspect and correct a failed operation
69
87
 
70
- - Traffic inspection: what the app actually did, live, in the `pyric dev --ui` console or through the `@pyric/ui` traffic and events components.
71
- - Denial inspection: a rejected operation carries its verdict instead of a bare `permission-denied` error.
72
- - Capture and replay: `pyric snapshot` records state, and captured sessions replay through the same event stream, which is what `pyric verify` is built on.
88
+ Pyric Studio shows local data, requests, authentication state, Security Rules verdicts, and denied operations. Open `/__pyric/ui/` on the development server and reproduce the failure. A denied request includes the path and verdict needed to correct the rule or the application code.
73
89
 
74
- ## Browser Sandbox connected to local MCP
90
+ The Vite plugin discovers the Firestore rules path from `firebase.json`, or falls back to `firestore.rules`. Saving that file replaces the active local ruleset without a production deploy. A parse failure leaves the last valid ruleset active and reports the error in the development server.
75
91
 
76
- Pyric provides a local MCP server with 51 tools. Yes, that's a lot. But the surface is wide because Firebase's is, and there's ongoing work to consolidate it into fewer, sharper tools. Pyric connects the browser sandbox to the server over a web socket bridge (the included [Claude Code plugin](pyric-plugin/README.md) auto-wires this) or composes programmatically into any agent framework. The inventory is in [docs/agent-tools.md](docs/agent-tools.md). The tools unique to its environment:
92
+ State and test identities stay browser-local by default. Add `persist: true` to write a committable `.pyric/state/state.json`, or use `seed` to start from a known scenario:
77
93
 
78
- - `firestore_simulate_rules` and `rtdb_simulate_access` evaluate a rules verdict for a hypothetical operation without performing it.
79
- - `firestore_simulator_*` runs a stateful Firestore session with seed, execute, batch, transaction, undo, redo, and an inspectable event log.
80
- - `sandbox_inspect`, `firestore_discover_paths`, and `rtdb_crawl_structure` map what exists in the data and how it is shaped.
81
- - `rtdb_validated_write` runs pre-flight checks before writing: it infers the schema at the target path, validates the payload against it, and simulates the rules verdict, returning schema warnings and simulation results alongside the write outcome.
82
- - `firestore_extract_indexes` derives composite-index definitions from the query shapes in source.
83
- - The deploy factories (`firestore_deploy_rules`, `firestore_deploy_indexes`, `rtdb_deploy_rules`, `hosting_deploy`, `functions_deploy`) drive the Firebase control plane over REST, without the `firebase-tools` CLI.
94
+ ```ts
95
+ pyricSandbox({
96
+ persist: true,
97
+ seed: 'seed.json',
98
+ });
99
+ ```
84
100
 
85
- ## Work that carries to production
101
+ See [persistence and multi-tab behavior](packages/cli/docs/how-to/serve-persistence-and-multi-tab.md) for reset and seed precedence.
86
102
 
87
- A sandbox session produces the artifacts a production deploy needs. Rules leave the sandbox already exercised against the app's actual behavior; `pyric deploy rules` ships them. Composite indexes come from `firestore_extract_indexes` instead of a hand-maintained `firestore.indexes.json`; `pyric deploy indexes` ships those. And `pyric verify` replays a captured session against a candidate ruleset and reports which operations change verdict before production finds out.
103
+ ## Give coding agents the same local Firebase target
88
104
 
89
- ## What matches Firebase and what doesn't
105
+ An agent can keep writing the same Firebase code while inspecting and changing the backend that the application is already using. Agent access is opt-in. Enable the MCP bridge in the Vite plugin:
90
106
 
91
- A sandbox is only useful if it behaves like the real service. The evidence: 138 committed observations of production Firebase behavior, replayed against the sandbox in CI on every change, and a public compatibility matrix of 610 rows, 539 conforming today. Known divergences are documented rather than hidden, and an undocumented divergence is treated as a bug.
107
+ ```ts
108
+ pyricSandbox({ bridge: true });
109
+ ```
92
110
 
93
- Per service: [Firestore](packages/pyric/docs/firestore/COMPAT.md), [Auth](packages/pyric/docs/auth/COMPAT.md), [Realtime Database](packages/pyric/docs/database/COMPAT.md), [Storage](packages/pyric/docs/storage/COMPAT.md). How the system works: [running the conformance system](docs/conformance/how-to-run-the-conformance-system.md).
111
+ The bridge mounts on the Vite development origin and routes agent operations to the same SharedWorker backend used by the application and Studio. The included [Claude Code plugin](pyric-plugin/README.md) discovers that bridge, while other MCP clients can connect to its HTTP endpoint.
94
112
 
95
- ## Using the packages directly
113
+ This protects the local workflow, not an independently credentialed process. A coding agent with production Firebase credentials or deployment access can still affect production outside Pyric.
96
114
 
97
- Most apps never import Pyric. For tests, Node scripts, and programmatic control of sandboxes, the `pyric/*` and `pyric-admin/*` packages mirror the Firebase SDKs' shape:
115
+ ## Verify the rules boundary
98
116
 
99
- ```js
100
- import { initializeSandbox } from 'pyric/sandbox';
101
- import { initializeApp } from 'pyric-admin/app';
102
- import { getDatabase } from 'pyric-admin/database';
117
+ Development sessions capture Firestore and Realtime Database operations in `.pyric/last-session.json` by default. Replay those requests against candidate rules before deployment:
103
118
 
104
- initializeApp({ sandbox: initializeSandbox() }); // the only non-firebase-admin line
105
- const db = getDatabase();
106
- await db.ref('rooms/lobby').set({ topic: 'launch day' });
119
+ ```bash
120
+ npx pyric verify
107
121
  ```
108
122
 
109
- | Package | Purpose | Docs |
110
- |---|---|---|
111
- | `pyric` | Web SDK mirror, rules tooling, sandbox runtime | [docs](packages/pyric/docs/) |
112
- | `pyric-admin` | `firebase-admin` mirror over sandbox or production | [docs](packages/pyric-admin/docs/firestore/) |
113
- | `pyric-tools` | The `pyric` CLI: `dev`, `init`, MCP bridge, deploy, verify | [docs](packages/pyric-tools/docs/) |
114
- | `@pyric/ui` | Headless React admin components and hooks | [docs](packages/ui/docs/) |
115
- | `@pyric/studio` | The local console behind `pyric dev --ui` | [README](packages/studio/README.md) |
123
+ The default engine runs locally. The optional Firestore Rules Test API engine sends derived rule cases to Google's hosted evaluator when production-authority verification is needed. It verifies rules and does not deploy them. See [verify against a captured session](packages/cli/docs/how-to/verify-against-a-captured-session.md).
124
+
125
+ ## Ship the same application code
126
+
127
+ A standard Vite production build leaves the development swap inactive:
116
128
 
117
129
  ```bash
118
- npm install -D pyric-tools # the CLI; sufficient for most apps
119
- npm install pyric pyric-admin # for direct sandbox control
130
+ npm run build
120
131
  ```
121
132
 
122
- Node 22 or later. All packages are ESM-only with subpath exports (`pyric/firestore`, not `pyric`).
133
+ The built application contains the real Firebase SDK and uses the Firebase configuration already present in the source. Deploy the build, rules, and indexes with `firebase-tools` or the Firebase Console. Pyric has no production deployment path.
134
+
135
+ ## Check what Pyric mirrors
123
136
 
124
- ## Development
137
+ Pyric is an independent implementation of observable Firebase behavior. Conformance evidence records what has been compared with Firebase and keeps five outcomes distinct: conforms, documented divergence, bug, unsupported, and unverified. The evidence is a floor, not a claim that every Firebase behavior has been measured.
138
+
139
+ Read the generated matrices for [App](packages/pyric/docs/app/COMPAT.md), [Auth](packages/pyric/docs/auth/COMPAT.md), [Firestore](packages/pyric/docs/firestore/COMPAT.md), [Realtime Database](packages/pyric/docs/database/COMPAT.md), [Storage](packages/pyric/docs/storage/COMPAT.md), [Messaging](packages/pyric/docs/messaging/COMPAT.md), [AI Logic](packages/pyric/docs/ai/COMPAT.md), [Security Rules](packages/pyric/docs/rules/COMPAT.md), and [Functions with Realtime Database](packages/cli/docs/functions-rtdb/COMPAT.md). The [versioning and compatibility policy](packages/pyric/docs/explanation/versioning-and-compatibility.md) explains the release boundary.
140
+
141
+ ## Stability
125
142
 
126
- Requires Bun and Node 22 or later.
143
+ Pyric is alpha software, currently `0.1.0-alpha.8`. Firebase-shaped surfaces are tracked through the compatibility matrices. Pyric-specific development APIs may change between alpha releases. All packages are ESM-only and require Node 22.15 or later.
144
+
145
+ ## Develop Pyric
146
+
147
+ The repository is a Bun workspace:
127
148
 
128
149
  ```bash
129
150
  bun install
130
151
  bun run build
131
- bun test packages/pyric packages/pyric-admin packages/pyric-tools packages/ui
132
- npm run test:packaging
152
+ bun run test
153
+ bun run compat:check
133
154
  ```
134
155
 
135
- Examples: [examples/vite-sandbox-app](examples/vite-sandbox-app/), the shape `pyric init --template web` generates, and [examples/admin-playground](examples/admin-playground/), a `@pyric/ui` showcase.
136
-
137
- ## Stability
138
-
139
- Alpha, `0.1.0-alpha.7`, published as an experimental product. The one stability goal is the Firebase mirror: code written against mirrored surfaces is intended to keep working, tracked in the compatibility matrices. Pyric-specific APIs (sandbox lifecycle, replay, serve and bridge internals) are public-alpha and may change between releases.
156
+ See [CONTRIBUTING.md](CONTRIBUTING.md), [CONTEXT.md](CONTEXT.md), and [AGENTS.md](AGENTS.md) before changing the codebase.
package/README.md.orig CHANGED
@@ -1,27 +1,28 @@
1
- # pyric-admin
1
+ # `pyric-admin`
2
2
 
3
- Firebase Admin-shaped adapters that can run against either a Pyric sandbox or
4
- real Firebase Admin SDK backends.
3
+ Firebase Admin-shaped adapters for a Pyric sandbox.
5
4
 
6
- Use `pyric-admin` when you want server/admin ergonomics while keeping the same
7
- backend-selection model as the client package.
5
+ Use these subpaths when tests, development servers, or scripts need
6
+ `firebase-admin` ergonomics against local or browser-hosted sandbox state. In
7
+ activated development, `@pyric/cli/register` resolves canonical
8
+ `firebase-admin/*` imports here. With activation absent, production execution
9
+ loads `firebase-admin` directly.
8
10
 
9
- > **Alpha.** This package is an early alpha. The admin-shaped subpaths are
10
- > best-effort mirror contracts of `firebase-admin` not guaranteed parity.
11
- > Any exported surface beyond the mirrored shapes is experimental public-alpha
12
- > and may change without notice.
11
+ > **Alpha.** These are best-effort mirror contracts of `firebase-admin`. Read
12
+ > the conformance matrices and service references for implemented behaviour and
13
+ > explicit gaps.
13
14
 
14
15
  ## Subpaths
15
16
 
16
- | Subpath | Surface |
17
+ | Subpath | Sandbox surface |
17
18
  |---|---|
18
- | `pyric-admin/app` | Admin app initialization for sandbox or production |
19
- | `pyric-admin/firestore` | Admin Firestore shape over sandbox or `firebase-admin/firestore` |
20
- | `pyric-admin/auth` | Admin Auth shape over sandbox or `firebase-admin/auth` |
21
- | `pyric-admin/database` | Admin Realtime Database shape over sandbox or `firebase-admin/database` |
22
- | `pyric-admin/storage` | Admin Storage shape over sandbox or `firebase-admin/storage` |
19
+ | `pyric-admin/app` | Admin app registry and sandbox binding |
20
+ | `pyric-admin/firestore` | Admin Firestore shape |
21
+ | `pyric-admin/auth` | Admin Auth shape |
22
+ | `pyric-admin/database` | Admin Realtime Database shape |
23
+ | `pyric-admin/storage` | Admin Storage shape |
23
24
 
24
- ## Example
25
+ ## Explicit sandbox setup
25
26
 
26
27
  ```ts
27
28
  import { initializeApp } from 'pyric-admin/app';
@@ -34,16 +35,14 @@ const db = getFirestore(app);
34
35
  await db.collection('posts').doc('hello').set({ title: 'Hello' });
35
36
  ```
36
37
 
37
- Production apps pass normal Firebase Admin credentials:
38
+ For unchanged server source, keep `firebase-admin/*` imports and run the
39
+ development command through `pyric dev`. Production runs the same source
40
+ without sandbox activation and therefore resolves Firebase Admin directly.
38
41
 
39
- ```ts
40
- import { initializeApp, cert } from 'pyric-admin/app';
41
-
42
- const app = initializeApp({
43
- credential: cert(serviceAccount),
44
- });
45
- ```
46
-
47
- ## Docs
42
+ ## Documentation
48
43
 
49
- - [Firestore docs](docs/firestore/)
44
+ - [App registry and activation](docs/app/)
45
+ - [Firestore](docs/firestore/)
46
+ - [Auth API](https://pyric.dev/docs/pyric-admin-auth-reference-api/)
47
+ - [Realtime Database API](https://pyric.dev/docs/pyric-admin-database-reference-api/)
48
+ - [Storage API](https://pyric.dev/docs/pyric-admin-storage-reference-api/)