@rundiffusion/ledger 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 RunDiffusion
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,70 @@
1
+ # @rundiffusion/ledger
2
+
3
+ `rdt` is a Git-native engineering task, claim, delivery, and accountability CLI.
4
+ It stores no company data outside the repository that invokes it:
5
+
6
+ - Markdown on the default branch is the durable task and shiplog ledger.
7
+ - remote Git refs arbitrate active claims and pin handoffs;
8
+ - Git history records authorship and evidence;
9
+ - repository CI decides what may merge.
10
+
11
+ There is no database, hosted service, daemon, telemetry, HTTP client, or
12
+ persistent cache. Any JSON audit output is a disposable CI artifact.
13
+
14
+ ## Develop
15
+
16
+ Use Node 22.15 or newer:
17
+
18
+ ```sh
19
+ npm ci
20
+ npm test
21
+ ```
22
+
23
+ The integration suite creates temporary bare Git remotes and proves claim
24
+ races, exact-SHA leases, immutable handoffs, and delivery accountability.
25
+
26
+ To exercise the CLI from a repository containing
27
+ `accountability.config.json`:
28
+
29
+ ```sh
30
+ npm run build
31
+ node /path/to/devapps/ledger/dist/cli.js check
32
+ ```
33
+
34
+ ## Package safety
35
+
36
+ Before publishing, run:
37
+
38
+ ```sh
39
+ npm ci
40
+ npm test
41
+ npm pack --dry-run --json
42
+ ```
43
+
44
+ The package `files` allowlist permits only `dist/`, this README, and the MIT
45
+ license. Inspect the dry-run JSON and reject the release if it includes tests,
46
+ fixtures, credentials, repository configuration, tasks, shiplogs, or plans.
47
+
48
+ The runtime dependency list intentionally contains only the generic YAML
49
+ parser. Do not add network clients, database drivers, telemetry, or caches.
50
+
51
+ ## Manual release
52
+
53
+ The canonical source remains in the private `image-ai` Bitbucket repository,
54
+ so v0.1.0 uses a manual public npm release rather than public-GitHub OIDC:
55
+
56
+ ```sh
57
+ npm login
58
+ npm publish --access public --otp <current-2fa-code>
59
+ ```
60
+
61
+ Never commit an npm token. Publish from a clean commit, with npm 2FA enabled,
62
+ after reviewing `npm pack --dry-run --json`. Consumer repositories exact-pin
63
+ the published version in their lockfiles.
64
+
65
+ ## Repository contract
66
+
67
+ Each consumer supplies `accountability.config.json`, `tasks/`, `shiplog/`, and
68
+ `plans/`. Run `rdt --help` for the public commands. Daily operating guidance
69
+ belongs in the consuming repository's `docs/agents/engineering-ledger.md` so
70
+ that humans and agents see the same policy beside the code.
package/dist/args.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ import type { ParsedArgs } from './types.js';
2
+ export declare function parseArgs(argv: string[]): ParsedArgs;
3
+ //# sourceMappingURL=args.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.d.ts","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAc7C,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,UAAU,CA4BpD"}
package/dist/args.js ADDED
@@ -0,0 +1,43 @@
1
+ const BOOLEAN_OPTIONS = new Set([
2
+ 'audit',
3
+ 'ci',
4
+ 'final',
5
+ 'force',
6
+ 'help',
7
+ 'hygiene',
8
+ 'new',
9
+ 'offline',
10
+ 'rollback',
11
+ ]);
12
+ export function parseArgs(argv) {
13
+ const [command = 'list', ...rest] = argv;
14
+ const positional = [];
15
+ const options = new Map();
16
+ for (let index = 0; index < rest.length; index += 1) {
17
+ const token = rest[index] ?? '';
18
+ if (!token.startsWith('--')) {
19
+ positional.push(token);
20
+ continue;
21
+ }
22
+ const equals = token.indexOf('=');
23
+ const rawName = token.slice(2, equals < 0 ? undefined : equals);
24
+ const name = rawName.replace(/_/g, '-');
25
+ if (!name)
26
+ throw new Error('Empty option name');
27
+ if (equals >= 0) {
28
+ options.set(name, token.slice(equals + 1));
29
+ continue;
30
+ }
31
+ if (BOOLEAN_OPTIONS.has(name)) {
32
+ options.set(name, true);
33
+ continue;
34
+ }
35
+ const value = rest[index + 1];
36
+ if (!value || value.startsWith('--'))
37
+ throw new Error(`--${name} requires a value`);
38
+ options.set(name, value);
39
+ index += 1;
40
+ }
41
+ return { command, positional, options };
42
+ }
43
+ //# sourceMappingURL=args.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"args.js","sourceRoot":"","sources":["../src/args.ts"],"names":[],"mappings":"AAEA,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,OAAO;IACP,IAAI;IACJ,OAAO;IACP,OAAO;IACP,MAAM;IACN,SAAS;IACT,KAAK;IACL,SAAS;IACT,UAAU;CACX,CAAC,CAAC;AAEH,MAAM,UAAU,SAAS,CAAC,IAAc;IACtC,MAAM,CAAC,OAAO,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,GAAG,IAAI,CAAC;IACzC,MAAM,UAAU,GAAa,EAAE,CAAC;IAChC,M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AC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzB,KAAK,IAAI,CAAC,CAAC;IACb,CAAC;IACD,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,CAAC;AAC1C,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,36 @@
1
+ #!/usr/bin/env node
2
+ import { parseArgs } from './args.js';
3
+ import { findRepoRoot, loadConfig } from './config.js';
4
+ import { dispatch } from './commands.js';
5
+ const HELP = `rdt - Git-native engineering ledger
6
+
7
+ Usage:
8
+ rdt list [--offline]
9
+ rdt next [--offline]
10
+ rdt new --title <text> --outcome <text> --context <text> --acceptance <csv> --validation <csv> --areas <csv> [--from <pushed-branch>]
11
+ rdt start [TASK-ID]
12
+ rdt submit [TASK-ID] [--new] [--final]
13
+ rdt handoff TASK-ID --reason <text> [--responsible <identity>]
14
+ rdt release TASK-ID --reason <text>
15
+ rdt takeover TASK-ID --reason <text>
16
+ rdt ship TASK-ID --evidence <text> [--commit <sha>] [--rollback]
17
+ rdt verify TASK-ID --evidence <text>
18
+ rdt check [--ci] [--audit] [--hygiene] [--json <path>]
19
+
20
+ The repository's accountability.config.json defines its ID prefix, default
21
+ branch, areas, staleness thresholds, and linkage enforcement level.`;
22
+ async function main() {
23
+ const argv = process.argv.slice(2);
24
+ if (argv.includes('--help') || argv[0] === 'help' || argv[0] === '-h') {
25
+ console.log(HELP);
26
+ return;
27
+ }
28
+ const root = findRepoRoot();
29
+ const config = loadConfig(root);
30
+ await dispatch({ root, config }, parseArgs(argv));
31
+ }
32
+ main().catch(error => {
33
+ console.error(error instanceof Error ? error.message : String(error));
34
+ process.exitCode = 1;
35
+ });
36
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,MAAM,IAAI,GAAG;;;;;;;;;;;;;;;;oEAgBuD,CAAC;AAErE,KAAK,UAAU,IAAI;IACjB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACnC,IAAI,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,MAAM,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;QACtE,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAClB,OAAO;IACT,CAAC;IACD,MAAM,IAAI,GAAG,YAAY,EAAE,CAAC;IAC5B,MAAM,MAAM,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC;IAChC,MAAM,QAAQ,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;AACpD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE;IACnB,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,19 @@
1
+ import type { LedgerConfig, ParsedArgs } from './types.js';
2
+ interface Context {
3
+ root: string;
4
+ config: LedgerConfig;
5
+ }
6
+ export declare function commandList(context: Context, args: ParsedArgs): Promise<void>;
7
+ export declare function commandNext(context: Context, args: ParsedArgs): Promise<void>;
8
+ export declare function commandNew(context: Context, args: ParsedArgs): Promise<void>;
9
+ export declare function commandStart(context: Context, args: ParsedArgs): Promise<void>;
10
+ export declare function commandSubmit(context: Context, args: ParsedArgs): Promise<void>;
11
+ export declare function commandShip(context: Context, args: ParsedArgs): Promise<void>;
12
+ export declare function commandVerify(context: Context, args: ParsedArgs): Promise<void>;
13
+ export declare function commandHandoff(context: Context, args: ParsedArgs): Promise<void>;
14
+ export declare function commandRelease(context: Context, args: ParsedArgs): Promise<void>;
15
+ export declare function commandTakeover(context: Context, args: ParsedArgs): Promise<void>;
16
+ export declare function commandCheck(context: Context, args: ParsedArgs): Promise<void>;
17
+ export declare function dispatch(context: Context, args: ParsedArgs): Promise<void>;
18
+ export {};
19
+ //# sourceMappingURL=commands.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../src/commands.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAe,YAAY,EAAE,UAAU,EAA6B,MAAM,YAAY,CAAC;AA+BnG,UAAU,OAAO;IACf,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,YAAY,CAAC;CACtB;AAmKD,wBAAsB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAmBnF;AAED,wBAAsB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAWnF;AAED,wBAAsB,UAAU,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAElF;AAED,wBAAsB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAgCpF;AA+CD,wBAAsB,aAAa,CAAC,OA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