filegrc 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 FileGRC contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,42 @@
1
+ # FileGRC
2
+
3
+ FileGRC is a zero-dependency Node.js engine for Git-native GRC workspaces. It validates structured JSON records and their Markdown companions, renders a local web app, provides safe CRUD operations, and builds a read-only audit view.
4
+
5
+ The audit workflow checks management-owned scope, policy and control adoption, engagement-specific management documents, authoritative source systems, verified operating evidence, and Type 2 population completeness. Type 1 as-of and Type 2 period packets distinguish drafts from delivery-ready output without claiming to replace the engagement team's evidence judgment. They include control, source-system, external-delivery, population, and evidence indexes, raw and historical source files, fixed attachments, and SHA-256 checksums.
6
+
7
+ Most users should create a complete workspace:
8
+
9
+ ```sh
10
+ npx create-filegrc@latest company-grc
11
+ ```
12
+
13
+ Inside a workspace:
14
+
15
+ ```sh
16
+ npx filegrc validate
17
+ npx filegrc serve
18
+ npx filegrc build
19
+ npx filegrc guide risk-assessment
20
+ npx filegrc scaffold risk-assessment --title "2026 Annual Risk Assessment"
21
+ npx filegrc list risk --json
22
+ npx filegrc references risk-example --json
23
+ npx filegrc describe risk
24
+ npx filegrc search "access review"
25
+ npx filegrc audit-readiness audit-id
26
+ npx filegrc prepare-audit audit-id
27
+ npx filegrc evidence-packet --start 2026-01-01 --end 2026-06-30 --audit audit-id
28
+ ```
29
+
30
+ Long-form Markdown lives beside its JSON record. FileGRC derives the Markdown path, so records do not store it.
31
+
32
+ Headless creates and updates accept either a record or `{ "record": {...}, "content": {...} }`, the same mutation shape used by the web app. Run `filegrc get <id> --mutation` before an update to include JSON and Markdown revision hashes; stale writes are rejected. Use `filegrc content <type> <id>` to read a companion and `--write <file|->` to replace it. `filegrc guide --json` is the compact action and resource index for agents.
33
+
34
+ Use `filegrc attach <evidence-id> <source-file>` to copy a fixed evidence file under its record and update `filePaths` without overwriting an existing attachment.
35
+
36
+ Use `filegrc detach <evidence-id> <attachment-name> --yes` for explicit removal. Evidence records with linked local attachments cannot be deleted.
37
+
38
+ The package requires Node.js 20 or newer. It uses Git for authors, commit timestamps, messages, diffs, and revisions. Browser commits are explicit. Without a remote they remain local; with a remote the browser commits and pushes together. Browser pulls use rebase. Agents and terminal users use Git directly; the FileGRC CLI does not wrap pull, commit, or push.
39
+
40
+ The editable server has no authentication and binds to loopback by default. Put it behind trusted authentication before exposing it on a network, or publish the read-only static build.
41
+
42
+ The authoritative data model ships in this package. Import the public Node.js API from `filegrc` and the model loader from `filegrc/model`.
package/bin/filegrc.js ADDED
@@ -0,0 +1,8 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { runCli } from "../src/cli.js";
4
+
5
+ runCli(process.argv.slice(2)).catch((error) => {
6
+ console.error(error instanceof Error ? error.message : String(error));
7
+ process.exitCode = 1;
8
+ });
package/model/index.js ADDED
@@ -0,0 +1,13 @@
1
+ import { readFileSync } from "node:fs";
2
+
3
+ export function loadModel(version = "1") {
4
+ const requested = String(version);
5
+ if (requested !== "1") throw new Error(`Unsupported data model version "${requested}". Available version: 1`);
6
+ return JSON.parse(readFileSync(new URL("./v1.json", import.meta.url), "utf8"));
7
+ }
8
+
9
+ export function getResourceDefinition(model, type) {
10
+ const definition = model.resources[type];
11
+ if (!definition) throw new Error(`Unknown resource type "${type}".`);
12
+ return definition;
13
+ }