create-filegrc 0.3.1 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-filegrc",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Create a filegrc workspace for a SOC 2 program",
5
5
  "license": "MIT",
6
6
  "repository": {
package/src/cli.js CHANGED
@@ -31,6 +31,9 @@ export async function runCli(argv = process.argv.slice(2)) {
31
31
  `${result.install === "installed" ? "installed" : "installation skipped"}`
32
32
  );
33
33
  console.log(`Git: ${result.gitMode === "existing-worktree" ? "joined existing worktree" : "initialized new repository"}`);
34
+ if (result.gitDetached) {
35
+ console.log("Warning: detached HEAD detected. Check out a branch before using browser commit, pull, or push.");
36
+ }
34
37
  console.log(`Timezone: ${result.values.timezone}`);
35
38
  for (const stage of result.stages) {
36
39
  console.log(`Stage ${stage.id}: ${stage.status}${stage.status === "created" ? ` (${stage.records} records)` : ""}`);
@@ -45,12 +48,21 @@ export async function runCli(argv = process.argv.slice(2)) {
45
48
  console.log(` cd ${shellQuote(result.target)}`);
46
49
  if (options.install === false) console.log(" npm install");
47
50
  if (!result.setup) console.log(" npx filegrc setup");
51
+ if (result.setup) console.log(" npx filegrc program-path --next --json");
48
52
  console.log(" npm run validate");
49
53
  console.log(" npm run serve");
50
54
  console.log("");
51
55
  if (result.setup) {
52
56
  console.log(`Service setup: ${result.setup.system.id} (${result.setup.system.status}), target ${result.setup.target.assuranceGoal}.`);
57
+ if (result.setup.draft) {
58
+ console.log("Planned and in scope means selected for scope review, not approved or active.");
59
+ }
53
60
  }
61
+ console.log("Immediate human decisions:");
62
+ console.log(result.setup?.target.assuranceGoal && result.setup.target.assuranceGoal !== "none"
63
+ ? ` 1. Confirm the selected assurance goal with management: ${assuranceGoalLabel(result.setup.target.assuranceGoal)}.`
64
+ : " 1. Select and confirm the assurance goal.");
65
+ console.log(" 2. Appoint an independent reviewer who is separate from the policy owner.");
54
66
  console.log("Review the generated records, then commit the approved baseline.");
55
67
  }
56
68
 
@@ -58,6 +70,13 @@ function shellQuote(value) {
58
70
  return `'${String(value).replaceAll("'", "'\\''")}'`;
59
71
  }
60
72
 
73
+ function assuranceGoalLabel(value) {
74
+ if (value === "soc-2-type-1") return "SOC 2 Type 1";
75
+ if (value === "soc-2-type-2") return "SOC 2 Type 2";
76
+ if (value === "readiness") return "Program Readiness";
77
+ return "No assurance goal selected";
78
+ }
79
+
61
80
  function parseArgs(argv) {
62
81
  let target;
63
82
  const options = {};
package/src/index.js CHANGED
@@ -50,6 +50,7 @@ export async function createFilegrc(options = {}) {
50
50
  }
51
51
  const joinedExistingWorktree = await isInsideGitWorktree(target);
52
52
  if (!joinedExistingWorktree) await run("git", ["init"], target);
53
+ const gitHead = await inspectGitHead(target);
53
54
  const setup = options.setup ? await runCombinedSetup(target, options.setup) : null;
54
55
  const resourceCounts = setup ? await summarizeResources(target) : initialResourceCounts;
55
56
  return {
@@ -64,7 +65,9 @@ export async function createFilegrc(options = {}) {
64
65
  resourceCounts,
65
66
  setup,
66
67
  install: installed ? "installed" : "skipped",
67
- gitMode: joinedExistingWorktree ? "existing-worktree" : "initialized"
68
+ gitMode: joinedExistingWorktree ? "existing-worktree" : "initialized",
69
+ gitBranch: gitHead.branch,
70
+ gitDetached: gitHead.detached
68
71
  };
69
72
  }
70
73
 
@@ -449,13 +452,13 @@ async function runCombinedSetup(target, input) {
449
452
  async function writeMinimalLockfile(target, name, versionRange) {
450
453
  const lock = {
451
454
  name,
452
- version: "0.3.1",
455
+ version: "0.3.3",
453
456
  lockfileVersion: 3,
454
457
  requires: true,
455
458
  packages: {
456
459
  "": {
457
460
  name,
458
- version: "0.3.1",
461
+ version: "0.3.3",
459
462
  dependencies: { filegrc: versionRange }
460
463
  }
461
464
  }
@@ -472,6 +475,20 @@ async function isInsideGitWorktree(target) {
472
475
  }
473
476
  }
474
477
 
478
+ async function inspectGitHead(target) {
479
+ try {
480
+ const { stdout } = await execute("git", ["symbolic-ref", "--quiet", "--short", "HEAD"], { cwd: target });
481
+ return { branch: stdout.trim() || null, detached: false };
482
+ } catch {
483
+ try {
484
+ await execute("git", ["rev-parse", "--verify", "HEAD"], { cwd: target });
485
+ return { branch: null, detached: true };
486
+ } catch {
487
+ return { branch: null, detached: false };
488
+ }
489
+ }
490
+ }
491
+
475
492
  async function run(command, args, cwd) {
476
493
  try {
477
494
  return await execute(command, args, { cwd, maxBuffer: 10_000_000 });
@@ -12,13 +12,13 @@ Do not guess a resource type, field name, enum value, relationship, or file path
12
12
 
13
13
  ```sh
14
14
  npx filegrc guide --json
15
- npx filegrc program-path --json
15
+ npx filegrc program-path --next --json
16
16
  npx filegrc guide risk-assessment --json
17
17
  npx filegrc list person --json
18
18
  npx filegrc program-readiness --summary --json
19
19
  ```
20
20
 
21
- `program-path` gives agents the same six-step order, exact page Instructions, Use, Policy Basis, commands, current state, and next actions shown in the renderer. The general guide lists every supported action and record type. A type guide repeats that page guidance and adds timing, required and conditional fields, current relationship candidates, JSON location, and Markdown slots.
21
+ `program-path --next --json` gives agents the current step and first action. Use `--summary` for all six step statuses or `--current` for the current step’s full renderer Instructions, Use, Policy Basis, commands, and next actions. The general guide lists every supported action and record type. A type guide repeats that page guidance and adds timing, required and conditional fields, current relationship candidates, JSON location, and Markdown slots.
22
22
 
23
23
  For a new record, generate a mutation envelope:
24
24
 
@@ -4,28 +4,9 @@
4
4
 
5
5
  Run a SOC 2 program as files in Git.
6
6
 
7
- filegrc gives a founder-led engineering team one place to adopt policies, implement controls, test External Evidence collection, run recurring compliance work, and prepare an audit. JSON holds structured records, Markdown holds long-form work, and Git supplies the change history.
7
+ filegrc gives founder-led engineering teams one place to adopt policies, implement controls, run recurring work, collect evidence, and prepare an audit.
8
8
 
9
- There is no separate application database. The repository is the program, so engineers and agents can use the same data through the web app, a text editor, or the CLI.
10
-
11
- ## Why it exists
12
-
13
- SOC 2 work tends to scatter across documents, calendars, tickets, screenshots, and the auditor’s request list. That makes it hard to answer basic questions: What is due? Which policy requires it? What changed during the audit period? Is the evidence complete?
14
-
15
- filegrc keeps that work connected:
16
-
17
- - A starter Security program links criteria references, policies, planned controls, owners, and schedules.
18
- - Work Queue turns policy timing into upcoming, due, and overdue work.
19
- - Policy Events add the required hiring, departure, vendor, incident, and change tasks to the Work Queue.
20
- - Program Readiness says whether management can begin a candidate Type 2 evidence period without an audit record.
21
- - Audit Readiness starts later with the CPA engagement, formal period, fieldwork documents, populations, and evidence delivery.
22
- - The packet builder produces a scoped, indexed delivery with source files, attachments, history, and checksums.
23
-
24
- The starter content is a proposal, not a claim of compliance. Review every policy and planned control against how your company actually operates before approving it.
25
-
26
- ## Start a workspace
27
-
28
- You need Node.js 20 or newer and Git.
9
+ It is open source, MIT licensed, and runs locally.
29
10
 
30
11
  ```sh
31
12
  npx create-filegrc@latest company-grc
@@ -34,96 +15,64 @@ npm run validate
34
15
  npm run serve
35
16
  ```
36
17
 
37
- The default `security` starter builds the full proposed SOC 2 Security program. Use `--starter foundation` to create only the five structural records when you want to select a framework and program content later. Company and service values can also be supplied together through `create-filegrc --config setup.json`.
38
-
39
- Setup asks for the legal organization name, the initial policy owner and their email, a security reporting address, and the program timezone. It initializes Git when needed. The first local run then defines the initial service boundary and an optional program goal. A Type 2 choice records management intent, not an audit engagement. Completing onboarding opens Step 1 so you can add the real reviewers and operators, finish the oversight team, and confirm the criteria, commitments, vendors, and systems before moving on.
40
-
41
- Open the printed local URL. You can commit locally from Repository without configuring a remote. Add a remote when the team is ready to share the workspace, then the browser can pull with rebase and push reviewed commits.
42
-
43
- The creation summary reports the resolved engine version, program timezone, starter record counts, install result, and whether the target joined an existing Git worktree. Generated workspaces receive an organization-specific README with their engine version, validation commands, and remaining setup work.
18
+ Requires Node.js 20 or newer and Git.
44
19
 
45
20
  ## How it works
46
21
 
47
- 1. Confirm the program’s people and oversight team, applicable criteria, commitments, material vendors, and in-scope systems.
48
- 2. Review and activate the policies with a separate management reviewer, who is usually internal and may be external.
49
- 3. Tailor the starter controls, add each owner, actual procedure, scope, cadence, evidence source, and implementation date, and confirm any linked Work Queue schedules are enabled. Marking a control implemented starts eligible schedules. Then record any complementary customer or subservice controls.
50
- 4. After confirming the applicable controls and authoritative source Systems, preview the proposed External Evidence drafts with `npx filegrc evidence-test-drafts --preview --json`. Create only the relevant drafts, collect each named artifact, and have another person verify it.
51
- 5. Start the management candidate period, maintain risk assessments and risks, update controls when needed, work the filegrc queue, and preserve dated evidence.
52
- 6. Engage a CPA firm, record the separate firm-agreed period, review filegrc Evidence and External Evidence, prepare fieldwork, and generate the evidence packet.
22
+ The repository is the program. There is no separate application database.
53
23
 
54
- Long-form policies, procedures, plans, minutes, training, assertions, and audit responses are Markdown companions beside their JSON records. Screenshots, signed acknowledgements, reports, and fixed exports are attachments linked through evidence records.
24
+ - **JSON** holds records that filegrc validates, filters, and connects.
25
+ - **Markdown** holds policies, procedures, plans, minutes, and narratives.
26
+ - **Git** supplies authors, timestamps, revisions, diffs, and commit messages.
55
27
 
56
- Third-party software is usually both a System and a Vendor. The application is the System because it operates controls and produces evidence. The provider is the Vendor because contracts, due diligence, and supplier risk belong to that relationship. Link the System to the Vendor with `vendorId`, and link exported evidence to the System.
28
+ Use the same source through the local web app, a text editor, the CLI, or CI. Browser and CLI actions call the same rules, so engineers and agents see the same validation and readiness results.
57
29
 
58
- ## Run the program
59
-
60
- Use Overview to follow one six-step path: define scope, approve policies, implement controls, test External Evidence, operate the program, then complete the audit. Steps 1 through 4 and Step 6 open an overview with instructions, record links, progress, and completion status. Step 5 opens Policy Events and the Work Queue because operation is ongoing rather than a one-time checklist. The progress tracker opens the first incomplete step.
30
+ ## One path from setup to audit
61
31
 
62
32
  ![filegrc SOC 2 program overview](docs/filegrc-home.png)
63
33
 
64
- Use Work Queue for recurring work, Policy Event tasks, and other assigned follow-up. Trigger a Policy Event when the underlying change occurs, and filegrc adds its required actions to the queue with their owners and deadlines. Create a separate Action Item only when follow-up needs its own assignee, deadline, and completion proof. Each queue item shows its due window or deadline. Link dated proof to close the work.
65
-
66
- Use the resource pages to maintain systems, people, vendors, risks, controls, tests, incidents, training, meetings, and External Evidence. The question-mark guide on each list explains what the record type is for, which policies call for it, and when to update it.
67
-
68
- Agents use the same logic headlessly:
69
-
70
- ```sh
71
- npx filegrc guide risk-assessment --json
72
- npx filegrc program-path --json
73
- npx filegrc scaffold risk-assessment --title "2026 Annual Risk Assessment"
74
- npx filegrc list risk --json
75
- npx filegrc obligations --json
76
- npx filegrc program-readiness --summary --json
77
- npx filegrc complete obligation-id completion-record.json
78
- npx filegrc trigger person-started --occurred-on 2026-07-25 --subject person-id
79
- npx filegrc complete-action action-item-id completion-record.json --completed-on 2026-07-25
80
- npx filegrc complete-event obligation-event-id --completed-on 2026-07-25
81
- npx filegrc search "access review"
82
- ```
83
-
84
- `program-path` reports the same six steps, current status, page order, exact Instructions, Use, Policy Basis, and next actions shown in the renderer. `program-readiness --summary --json` reports compact stage counts and next actions; omit `--summary` when you need every readiness item. `guide` reports that same page guidance for one resource, plus timing, required fields, valid values, relationship candidates, and Markdown locations. `scaffold` produces the same JSON and Markdown mutation shape used by the browser. Read `AGENTS.md` and `data/AGENTS.md` for the full headless workflow.
34
+ 1. **Define scope.** Confirm owners, criteria, commitments, vendors, and in-scope systems.
35
+ 2. **Approve policies.** Tailor the proposals and record separate owners and reviewers.
36
+ 3. **Implement controls.** Add the real procedure, scope, cadence, and evidence source.
37
+ 4. **Test evidence collection.** Collect and verify evidence from each authoritative system.
38
+ 5. **Operate the program.** Work the queue, trigger Policy Events, maintain risks, and preserve dated evidence.
39
+ 6. **Audit.** Record the CPA engagement and agreed period, support fieldwork, and build the packet.
85
40
 
86
- ## Start the evidence period
87
-
88
- Program Readiness works without an audit ID or CPA firm:
89
-
90
- ```sh
91
- npx filegrc program-readiness --json
92
- npx filegrc program-readiness --require-ready
93
- ```
41
+ The Program Overview shows what is done, what is blocked, and what to do next.
94
42
 
95
- The Evidence Ready gate requires defined scope, effective policies, implemented controls, configured authoritative systems, and verified collection for external evidence that does not already have a dedicated Step 5 record. Put scan reports, backup output, and other fixed artifacts in External Evidence records, then link them from the applicable Step 5 operating records. Starter obligations remain enabled proposals until their governing policies are effective and at least one linked control is implemented. A filegrc-managed control cannot be implemented while one of its linked Work Queue schedules is paused or waiting for policy approval.
43
+ ## The routine work stays connected
96
44
 
97
- When the gate passes, record `candidatePeriodStart` on the workspace on the date reliable collection begins. This is management’s candidate Type 2 period. Do not backdate it. The later audit record keeps the separate period agreed with the CPA firm.
45
+ - **Work Queue** turns policy schedules and follow-up into upcoming, due, and overdue work.
46
+ - **Policy Events** create the right tasks for hiring, departures, incidents, vendor changes, and other events.
47
+ - **Program Readiness** checks whether management can begin a reliable evidence period.
48
+ - **Audit Readiness** checks the engagement, period, documents, evidence, and Type 2 populations.
49
+ - **Evidence packets** collect the scoped records, attachments, history, indexes, and checksums for delivery.
98
50
 
99
- ## Prepare the audit
51
+ ![filegrc audit readiness](docs/filegrc-audit.png)
100
52
 
101
- After engaging a CPA firm, create the audit record with the firm, scope, and exact agreed date or period. Audit Readiness checks the program foundation, engagement, formal scope and dates, management documents, filegrc Evidence, External Evidence, and Type 2 populations.
53
+ Starter records connect policies, controls, owners, systems, evidence, and schedules. They are proposals, so review them against how your company actually works before approval.
102
54
 
103
- ![filegrc audit readiness](docs/filegrc-audit.png)
55
+ ## Built for engineers and agents
104
56
 
105
- For a Type 2 audit, reconcile each complete period population to its authoritative system after the period closes. A zero-item population still needs its source export and query. filegrc Evidence consists of dated operating records and their Markdown and Git history. External Evidence consists of verified exports, reports, screenshots, signed files, and approved external references. The packet compiles both paths with the selected records, attachments, indexes, historical versions, and SHA-256 checksums.
57
+ The browser is helpful, but it is not required. An agent can discover the model, inspect valid relationships, create records, complete scheduled work, trigger events, and check the result from the CLI.
106
58
 
107
59
  ```sh
108
- npx filegrc prepare-audit audit-id
60
+ npx filegrc program-path --next --json
61
+ npx filegrc guide risk-assessment --json
62
+ npx filegrc obligations --json
63
+ npx filegrc program-readiness --summary --json
109
64
  npx filegrc audit-readiness audit-id --json
110
65
  npx filegrc evidence-packet --audit audit-id
111
66
  ```
112
67
 
113
- filegrc checks management preparation and packet integrity. The independent CPA firm still selects samples, tests controls, evaluates exceptions, decides whether evidence is sufficient, and issues the SOC 2 report.
114
-
115
- Early CPA engagement remains available when a customer deadline, unusual scope, or other timing risk needs input before the program reaches Evidence Ready. It is optional, not the default first action.
116
-
117
- ## What belongs elsewhere
118
-
119
- filegrc does not replace workforce, identity, source-control, deployment, infrastructure, monitoring, endpoint, backup, vulnerability, training, signature, procurement, contract, or vendor-risk systems.
68
+ Read `AGENTS.md` and `data/AGENTS.md` inside a generated workspace for the full headless workflow.
120
69
 
121
- Catalog each authoritative system in filegrc, record how to export from it, and attach or reference the fixed evidence when Audit Readiness asks for it. The generated external-delivery index identifies files that still need to be supplied through an auditor portal or another approved channel.
70
+ ## Clear boundaries
122
71
 
123
- The starter uses the SOC 2 Security category and does not include licensed criteria text. Add Availability, Processing Integrity, Confidentiality, or Privacy only when they are in scope.
72
+ filegrc manages GRC records and audit evidence. Your workforce, identity, source control, infrastructure, monitoring, endpoint, backup, training, signature, procurement, and vendor systems still operate the controls and produce source evidence.
124
73
 
125
- ## Repository safety
74
+ The independent CPA firm still selects samples, tests controls, evaluates exceptions, decides whether evidence is sufficient, and issues the SOC 2 report.
126
75
 
127
- The editable server has no authentication and binds to loopback by default. Do not expose it to an untrusted network. Use `npm run build` for a read-only site.
76
+ Do not put secrets or personal data that may need erasure into Git. The editable local server has no authentication and binds to loopback by default.
128
77
 
129
- Do not put secrets or personal data that may need erasure into Git. Read `AGENTS.md` before broad record changes or automation work.
78
+ Learn more at [filegrc.com](https://filegrc.com) or [view the source on GitHub](https://github.com/Sunpeak-AI/filegrc).
@@ -20,7 +20,7 @@ Agents and terminal users can inspect the workspace without the browser:
20
20
 
21
21
  ```sh
22
22
  npx filegrc guide --json
23
- npx filegrc program-path --json
23
+ npx filegrc program-path --next --json
24
24
  npx filegrc obligations --json
25
25
  npx filegrc validate --json
26
26
  ```
@@ -8,14 +8,14 @@ Treat the installed model as the authority. Do not infer a schema from a nearby
8
8
 
9
9
  ```sh
10
10
  npx filegrc guide --json
11
- npx filegrc program-path --json
11
+ npx filegrc program-path --next --json
12
12
  npx filegrc types --json
13
13
  npx filegrc guide RESOURCE_TYPE --json
14
14
  npx filegrc list RESOURCE_TYPE --json
15
15
  npx filegrc search "TERM" --json
16
16
  ```
17
17
 
18
- Use `program-path` to find the current lifecycle step and see the renderer’s exact page Instructions, Use, Policy Basis, commands, and next actions. Use `guide` before any unfamiliar create or status transition. It repeats the page guidance and reports required fields, fields required by a status, enum values, relationship types and candidates, Markdown slots, timing, and exact paths. Use `describe` only when you need the raw model definition.
18
+ Use `program-path --next --json` to find the current lifecycle step and first action. Use `--summary` for all six step statuses or `--current` for the current step’s full renderer Instructions, Use, Policy Basis, commands, and next actions. Use `guide` before any unfamiliar create or status transition. It repeats the page guidance and reports required fields, fields required by a status, enum values, relationship types and candidates, Markdown slots, timing, and exact paths. Use `describe` only when you need the raw model definition.
19
19
 
20
20
  ## Choose the right record
21
21
 
Binary file
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "{{project_name}}",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "private": true,
5
5
  "description": "filegrc workspace for a SOC 2 program",
6
6
  "type": "module",