filegrc 0.4.0 → 0.5.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.
- package/README.md +11 -3
- package/model/index.js +9 -5
- package/model/v3.json +9391 -0
- package/package.json +2 -2
- package/src/agent.js +53 -0
- package/src/appointments.js +19 -0
- package/src/audit-preparation.js +47 -6
- package/src/audit-transition.js +96 -0
- package/src/batch-review.js +109 -0
- package/src/cli.js +418 -61
- package/src/collection-review.js +185 -0
- package/src/evidence-packet.js +34 -2
- package/src/external-reviewer.js +165 -0
- package/src/files.js +46 -10
- package/src/index.js +36 -2
- package/src/model-docs.js +15 -0
- package/src/model-migration.js +516 -21
- package/src/obligations.js +396 -13
- package/src/program-lifecycle.js +1 -0
- package/src/program-path.js +49 -12
- package/src/program-readiness.js +331 -27
- package/src/reconciliation.js +277 -0
- package/src/server.js +242 -14
- package/src/setup.js +36 -4
- package/src/source-coverage.js +61 -0
- package/src/state.js +37 -1
- package/src/validate.js +100 -3
- package/src/web.js +961 -202
- package/src/workflow.js +1595 -0
package/README.md
CHANGED
|
@@ -34,15 +34,23 @@ npx filegrc prepare-audit audit-id
|
|
|
34
34
|
npx filegrc evidence-packet --start 2026-01-01 --end 2026-06-30 --audit audit-id
|
|
35
35
|
```
|
|
36
36
|
|
|
37
|
-
## Upgrade
|
|
37
|
+
## Upgrade an existing workspace
|
|
38
38
|
|
|
39
|
-
The normal runtime uses data model
|
|
39
|
+
The normal runtime uses data model v3. Start a model v2 upgrade with a read-only preview:
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
npx filegrc migrate --to-model 3 --preview --json
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Review every automatic, review-required, and unsupported item. Resolve unsupported items before applying the same migration with `--yes`. The migration writes one atomic batch, validates model v3, changes no Git history, and is safe to rerun. The [model v3 upgrade guide](https://github.com/Sunpeak-AI/filegrc/blob/main/docs/upgrading-to-model-v3.md) explains every migration class and the review that follows.
|
|
46
|
+
|
|
47
|
+
A model v1 workspace must migrate to v2 first:
|
|
40
48
|
|
|
41
49
|
```sh
|
|
42
50
|
npx filegrc migrate --to-model 2 --preview --json
|
|
43
51
|
```
|
|
44
52
|
|
|
45
|
-
|
|
53
|
+
Follow the [model v2 upgrade guide](https://github.com/Sunpeak-AI/filegrc/blob/main/docs/upgrading-to-model-v2.md), then run the model v3 preview.
|
|
46
54
|
|
|
47
55
|
`filegrc serve --help` prints bind, port, environment, and safety options without starting the server. The editable server defaults to `127.0.0.1:8787`; set `FILEGRC_HOST`, `FILEGRC_PORT`, or the matching flags when needed. In trunk mode, browser saves synchronize, commit, and push from the authoritative branch. Use `--allow-non-authoritative-writes` for local development in a task checkout; the override never commits or pushes.
|
|
48
56
|
|
package/model/index.js
CHANGED
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import { readFileSync } from "node:fs";
|
|
2
2
|
|
|
3
|
-
export
|
|
3
|
+
export const ACTIVE_MODEL_VERSION = "3";
|
|
4
|
+
export const SUPPORTED_MODEL_VERSIONS = Object.freeze(["2", ACTIVE_MODEL_VERSION]);
|
|
5
|
+
|
|
6
|
+
export function loadModel(version = ACTIVE_MODEL_VERSION) {
|
|
4
7
|
const requested = String(version);
|
|
5
|
-
if (requested
|
|
8
|
+
if (!SUPPORTED_MODEL_VERSIONS.includes(requested)) {
|
|
9
|
+
const migrationTarget = requested === "1" ? "2" : "3";
|
|
6
10
|
throw new Error(
|
|
7
|
-
`Unsupported data model version "${requested}". This filegrc release
|
|
8
|
-
+
|
|
11
|
+
`Unsupported data model version "${requested}". This filegrc release supports models v2 and v3. `
|
|
12
|
+
+ `Run \`npx filegrc migrate --to-model ${migrationTarget} --preview --json\` from the workspace root.`
|
|
9
13
|
);
|
|
10
14
|
}
|
|
11
|
-
const model = JSON.parse(readFileSync(new URL(
|
|
15
|
+
const model = JSON.parse(readFileSync(new URL(`./v${requested}.json`, import.meta.url), "utf8"));
|
|
12
16
|
for (const [type, definition] of Object.entries(model.resources)) {
|
|
13
17
|
for (const [name, field] of Object.entries({ ...model.commonFields, ...definition.fields })) {
|
|
14
18
|
expandRegistryReference(model, field, `${type}.${name}`);
|