@aviaratech/ai-delivery 0.3.23 → 0.3.24

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.
Files changed (112) hide show
  1. package/CONTRIBUTING.md +9 -0
  2. package/README.md +56 -447
  3. package/dist/agent.d.ts +5 -11
  4. package/dist/agent.js +4 -8
  5. package/dist/agent.js.map +1 -1
  6. package/dist/cli.js +12 -107
  7. package/dist/cli.js.map +1 -1
  8. package/dist/config/deliveryConfig.d.ts +44 -55
  9. package/dist/config/deliveryConfig.js +85 -88
  10. package/dist/config/deliveryConfig.js.map +1 -1
  11. package/dist/config/deliveryConfig.test.js +13 -5
  12. package/dist/config/deliveryConfig.test.js.map +1 -1
  13. package/dist/delivery/common.js +7 -2
  14. package/dist/delivery/common.js.map +1 -1
  15. package/dist/delivery/delivery.test.js +2 -3
  16. package/dist/delivery/delivery.test.js.map +1 -1
  17. package/dist/delivery/index.d.ts +0 -6
  18. package/dist/delivery/index.js +0 -3
  19. package/dist/delivery/index.js.map +1 -1
  20. package/dist/delivery/legacy.d.ts +8 -0
  21. package/dist/delivery/legacy.js +5 -0
  22. package/dist/delivery/legacy.js.map +1 -0
  23. package/dist/delivery/policy.js +2 -13
  24. package/dist/delivery/policy.js.map +1 -1
  25. package/dist/directoryIndependent.test.d.ts +1 -0
  26. package/dist/directoryIndependent.test.js +262 -0
  27. package/dist/directoryIndependent.test.js.map +1 -0
  28. package/dist/dispatch.d.ts +29 -3
  29. package/dist/dispatch.js +160 -457
  30. package/dist/dispatch.js.map +1 -1
  31. package/dist/genericCompatibility.test.js +0 -35
  32. package/dist/genericCompatibility.test.js.map +1 -1
  33. package/dist/git.js +10 -3
  34. package/dist/git.js.map +1 -1
  35. package/dist/gitProcess.d.ts +6 -0
  36. package/dist/gitProcess.js +56 -0
  37. package/dist/gitProcess.js.map +1 -0
  38. package/dist/github/discovery.d.ts +1 -0
  39. package/dist/github/discovery.js +1 -1
  40. package/dist/github/discovery.js.map +1 -1
  41. package/dist/github/discovery.test.js +25 -20
  42. package/dist/github/discovery.test.js.map +1 -1
  43. package/dist/github/nativeIssueMetadata.d.ts +2 -2
  44. package/dist/github/nativeIssueMetadata.js.map +1 -1
  45. package/dist/github/projectDelivery.d.ts +1 -1
  46. package/dist/github/projectDelivery.js.map +1 -1
  47. package/dist/github/repo.d.ts +7 -1
  48. package/dist/github/repo.js +58 -2
  49. package/dist/github/repo.js.map +1 -1
  50. package/dist/issue.d.ts +11 -6
  51. package/dist/issue.js +136 -319
  52. package/dist/issue.js.map +1 -1
  53. package/dist/issueJournal.d.ts +1 -1
  54. package/dist/lifecycle.test.js +40 -7371
  55. package/dist/lifecycle.test.js.map +1 -1
  56. package/dist/logger.js +4 -4
  57. package/dist/logger.js.map +1 -1
  58. package/dist/mcp/tools.d.ts +26 -42
  59. package/dist/mcp/tools.js +33 -42
  60. package/dist/mcp/tools.js.map +1 -1
  61. package/dist/pluginInstaller.d.ts +1 -1
  62. package/dist/pluginPackaging.test.js +129 -0
  63. package/dist/pluginPackaging.test.js.map +1 -1
  64. package/dist/pr.d.ts +66 -114
  65. package/dist/pr.js +288 -1108
  66. package/dist/pr.js.map +1 -1
  67. package/dist/pr.test.js +295 -237
  68. package/dist/pr.test.js.map +1 -1
  69. package/dist/releaseReconciliation.test.d.ts +1 -0
  70. package/dist/releaseReconciliation.test.js +314 -0
  71. package/dist/releaseReconciliation.test.js.map +1 -0
  72. package/dist/review.d.ts +37 -7
  73. package/dist/review.js +106 -45
  74. package/dist/review.js.map +1 -1
  75. package/dist/review.test.js +30 -71
  76. package/dist/review.test.js.map +1 -1
  77. package/dist/services/agentReadinessService.d.ts +1 -1
  78. package/dist/services/agentReadinessService.js +2 -0
  79. package/dist/services/agentReadinessService.js.map +1 -1
  80. package/dist/services/deliveryAdmission.d.ts +4 -4
  81. package/dist/services/deliveryAdmission.js.map +1 -1
  82. package/dist/setup.test.js +10 -5
  83. package/dist/setup.test.js.map +1 -1
  84. package/dist/start.test.d.ts +1 -0
  85. package/dist/start.test.js +72 -0
  86. package/dist/start.test.js.map +1 -0
  87. package/dist/stdoutRegression.test.d.ts +1 -0
  88. package/dist/stdoutRegression.test.js +326 -0
  89. package/dist/stdoutRegression.test.js.map +1 -0
  90. package/dist/verification.d.ts +1 -27
  91. package/dist/verification.js +5 -1332
  92. package/dist/verification.js.map +1 -1
  93. package/dist/worktree.d.ts +1 -31
  94. package/dist/worktree.js +5 -200
  95. package/dist/worktree.js.map +1 -1
  96. package/dist/worktreeTransition.d.ts +1 -1
  97. package/dist/worktreeTransition.js +10 -5
  98. package/dist/worktreeTransition.js.map +1 -1
  99. package/dist/worktreeTransition.test.js +2 -3
  100. package/dist/worktreeTransition.test.js.map +1 -1
  101. package/package.json +1 -1
  102. package/plugins/ai-delivery/.claude-plugin/plugin.json +2 -2
  103. package/plugins/ai-delivery/README.md +3 -3
  104. package/plugins/ai-delivery/plugin.json +1 -1
  105. package/plugins/ai-delivery/runtime/dist/cli.js +50 -59
  106. package/plugins/ai-delivery/runtime/package.json +1 -1
  107. package/plugins/ai-delivery/skills/intake-create/SKILL.md +1 -1
  108. package/plugins/ai-delivery/skills/pr-handoff/SKILL.md +14 -21
  109. package/plugins/ai-delivery/skills/worktree-lifecycle/SKILL.md +12 -23
  110. package/dist/services/deliveryRecordService.d.ts +0 -47
  111. package/dist/services/deliveryRecordService.js +0 -199
  112. package/dist/services/deliveryRecordService.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aviaratech/ai-delivery",
3
- "version": "0.3.23",
3
+ "version": "0.3.24",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "ai-delivery": "./dist/cli.js"
@@ -34,7 +34,7 @@ The earlier default-JSON requirement remains in issue history, not in the active
34
34
  1. Use `issue_create` to create one coherent tracking issue with the applicable native issue metadata and relationships.
35
35
  2. Use `issue_info` to inspect a known issue and `issue_update` for authoritative metadata, relationship, or lifecycle changes.
36
36
  3. Run `issue_ready_check` before development. Resolve any reported gaps in the issue before proceeding.
37
- 4. Continue with `issue_develop` when the issue is ready.
37
+ 4. Continue with `issue_start` and an explicit repository when the issue is ready; prepare its worktree through the host.
38
38
 
39
39
  ## CLI fallback
40
40
 
@@ -1,33 +1,26 @@
1
1
  ---
2
2
  name: "ai-delivery:pr-handoff"
3
- description: Publish a verified change, submit independent review evidence, and complete guarded pull request delivery.
3
+ description: Publish a GitHub-linked change, submit exact-head independent App review and complete guarded delivery.
4
4
  ---
5
5
 
6
6
  # Pull request handoff
7
7
 
8
- Use the verified commit and its evidence throughout publication, review, and merge. If the commit changes, verify the new commit and obtain review for its exact pull request head.
8
+ Run contributor checks through the repository's normal workflow. Keep the resulting commit unchanged through publication and independent review; a changed head requires fresh checks and review.
9
9
 
10
- ## MCP tools first
10
+ Call `issue_pr_create` with explicit `repo`, issue number, a non-empty body and `dryRun: true`. Inspect configured actor and rule evidence, then create a draft from the GitHub-linked branch. Hosts own commits and pushes. Resolve missing credentials or same-actor routes; unknown approval eligibility is not approval.
11
11
 
12
- 1. Run `issue_verify` on the committed change.
13
- 2. Call `issue_pr_create` with `dryRun: true` and inspect its `reviewRoute`: selected author and reviewer actors, credential sources, effective reviewer Contents grant, repository access and rule visibility. A visible required-approval rule with a read-only reviewer App grant reports `insufficient-permission`; arrange an eligible independent reviewer or have the operator grant Contents write, accept the installation update and refresh its token before publication. Contents write grants code-write access. Resolve missing credentials or same-actor errors before publication. Unknown grants or rule visibility remain unknown; Contents write is not required merely to submit a review.
14
- 3. Publish as a draft with `issue_pr_create`, then inspect the actual PR author with `issue_pr_info` or GitHub readback. The selected author credential must make the push and PR; do not switch to an ambient connector.
15
- 4. Obtain independent review of the exact pull request head. Submit its artifact with `issue_pr_review` and the configured reviewer `identity`, so the selected reviewer GitHub App makes the review. Inspect the returned `reviewState`, including `submittedReviewAuthorCanPushToRepository` when available, and the live `reviewDecision`.
16
- 5. Promote the unchanged PR with `issue_pr_create` (`draft: false`), inspect live required-review state and checks, then use `issue_finish` only when GitHub requirements are satisfied.
12
+ Obtain a read-only independent review of the exact remote commit, tree and complete diff. Submit its artifact with `issue_pr_review` using the configured reviewer App. A matching review is reused. Inspect GitHub's live required-review decision and checks; submission alone does not prove the approval counted. Resolve stale/dismissed reviews, blockers, failed checks and moved heads or bases without relaxing protection.
17
13
 
18
- An `APPROVED` review receipt proves submission, not that GitHub counted it. If `reviewState` is `still-required`, inspect the active rule and obtain a qualifying independent approval. Do not repeat the same submission, replace the PR, change actors, or weaken protection automatically. Missing or stale evidence, a changed head, failed checks, conflicts, or unresolved blockers require resolution before continuing.
14
+ Promote the unchanged PR using `issue_pr_create` with `draft: false`. Finish only with satisfied GitHub requirements and fresh CLEAN eligibility. The merge mutation uses the independently reviewed SHA; finish confirms the intended PR merged before closing its issue. Hosts retain responsibility for local worktree cleanup.
19
15
 
20
- ## CLI fallback
21
-
22
- ```bash
23
- ai-delivery --identity <configured-author> verify
24
- ai-delivery --identity <configured-author> pr:create --issue <number> --dry-run
25
- ai-delivery --identity <configured-author> pr:create --issue <number>
26
- # obtain independent review of the exact pull request head
27
- ai-delivery --identity <configured-reviewer> pr:review --issue <number> --pr <number> --artifact ./review-artifact.json
28
- ai-delivery --identity <configured-author> pr:create --issue <number> --ready
29
- ai-delivery --identity <configured-author> pr:checks --pr <number>
30
- ai-delivery --identity <configured-author> finish --issue <number> --pr <number>
16
+ ```sh
17
+ ai-delivery --repo <owner/name> pr:create --issue <number> --body-file ./pr-body.md --dry-run
18
+ ai-delivery --repo <owner/name> pr:create --issue <number> --body-file ./pr-body.md
19
+ # Obtain independent exact-head review.
20
+ ai-delivery --repo <owner/name> pr:review --issue <number> --pr <number> --artifact ./review-artifact.json
21
+ ai-delivery --repo <owner/name> pr:create --issue <number> --ready
22
+ ai-delivery --repo <owner/name> pr:checks --pr <number>
23
+ ai-delivery --repo <owner/name> finish --issue <number> --pr <number> --reviewed-head <reviewed-sha>
31
24
  ```
32
25
 
33
- For the CLI, `--artifact` is the path to a UTF-8 JSON review artifact file, not inline JSON. The MCP `issue_pr_review` tool instead takes the JSON content as its `artifact` argument. The content is validated against the review artifact schema before submission.
26
+ CLI `--artifact` is a UTF-8 JSON file path. MCP takes the JSON content. Never fabricate effective model metadata or historical policy/evidence receipts. The artifact and counted independent App approval must bind the exact delivered head.
@@ -1,33 +1,22 @@
1
1
  ---
2
2
  name: "ai-delivery:worktree-lifecycle"
3
- description: Prepare an issue-backed or explicitly standalone worktree, develop there, and verify the resulting commit.
3
+ description: Start a GitHub-linked issue branch, prepare a host-owned worktree and verify its change through repository contributor checks.
4
4
  ---
5
5
 
6
- # Prepared worktree lifecycle
6
+ # Host-owned worktree lifecycle
7
7
 
8
- Use a registered prepared worktree for implementation so changes and delivery evidence stay associated with the intended issue.
8
+ Read user configuration and inspect `ai-delivery --repo <owner/name> config:resolve`. Confirm configured author and independent reviewer actors and repository access. Unknown GitHub rule visibility remains unknown.
9
9
 
10
- Before development, run the read-only `ai-delivery --identity <configured-author> config:resolve` in the selected checkout, or use `--identity personal --personal-auth config:resolve` for the explicit development override under an App author policy. Inspect the selected author and independent reviewer actors, credential sources, repository access and available review rules. Resolve missing credentials or actor/repository mismatches before preparing work. Unknown approval eligibility remains unknown; runtime admission is still required separately for lifecycle writes. Publication requires the configured author credential.
10
+ Use `issue_info` and `issue_ready_check` with an explicit `repo`, then `issue_start` with the existing issue number to create or reuse its GitHub-linked branch. Prepare the local worktree using the host's supported worktree tools. Run the repository's own contributor checks, commit and push through its normal workflow. The ai-delivery runtime never executes repository policy modules or checks, or creates local worktrees. Continue to pull request handoff at the unchanged remote head.
11
11
 
12
- ## MCP tools first
13
-
14
- 1. For tracked work, inspect the issue with `issue_info`, check it with `issue_ready_check`, then prepare it with `issue_develop`.
15
- 2. For explicitly standalone work, use `issue_worktree_create`.
16
- 3. Make changes in the prepared worktree, run the focused checks, and commit the change.
17
- 4. Run `issue_verify` after the commit. Continue to pull request handoff with the exact verified commit.
18
-
19
- To park execution without removing the worktree, call `issue_update` with `park: true` or `ai-delivery update --issue <number> --park`. The Project shows Todo or Blocked from current native blockers; closed/Done remains Done. Resume through `issue_develop`/`develop` with the existing readiness checks. A retained worktree does not establish active execution.
20
-
21
- For an unwitnessed legacy issue row, use the read-only `issue_worktree_transition_inspect` with purpose `active-resume` or `merged-cleanup`. Installation does not adopt the row. Preserve unknown historical evidence as original bytes; never treat it as current verification/review or operational closure. The supported closure family is the retained official public 0.3.5 archive/installed runtime admission, producer-bound run@3 and writers@1 on supported POSIX hosts. Missing closure, operative issue-cli v1/v2 or unknown resources must remain refused.
12
+ ```sh
13
+ ai-delivery --repo <owner/name> ready:check --issue <number>
14
+ ai-delivery --repo <owner/name> start --issue <number>
15
+ # Prepare a host-owned worktree, implement, run contributor checks, commit and push.
16
+ ```
22
17
 
23
- Apply only the exact plan with authenticated personal-operator native relinquishment and distinct configured reviewer-App whole-plan native acceptance. `issue_worktree_transition_apply` requires explicit authority, the saved plan/plan ID and both native comment IDs. Use the same inputs for interruption recovery. Pending and terminal-purpose intent blocks ordinary source mutations and re-registration. Active resume needs fresh current verification and review; original receipts retain their historical schema/accounting. Terminal disposition retains source/holds by default. Explicit unheld removal uses existing non-force cleanup; this skill grants no hold release, private adoption, launcher change, shared admission or legacy-protocol retirement authority.
18
+ Parking an issue with `issue_update({repo, issueNumber, park: true})` retains its remote tracking presentation. Worktree cleanup remains with the host owner.
24
19
 
25
- ## CLI fallback
20
+ Legacy `issue_worktree_transition_inspect` and `issue_worktree_transition_apply` preserve their separate custody contract. Preserve original bytes and accounting; unsupported configuration or closure bindings fail closed. Apply only an exact independently accepted plan with native personal-operator relinquishment, distinct reviewer-App acceptance, complete immutable inventory, runtime admission and quiescent writer proof. This skill grants no private adoption, hold release, launcher change, shared admission or protocol retirement authority.
26
21
 
27
- ```bash
28
- ai-delivery --identity <configured-author> config:resolve
29
- ai-delivery ready:check --issue <number>
30
- ai-delivery develop --issue <number>
31
- # edit, run focused checks, and commit in the prepared worktree
32
- ai-delivery verify
33
- ```
22
+ This runtime's CLI/MCP cannot reconstruct the historical repository-policy binding, so those transition commands refuse. Use the original controller for their successful execution; retained engine tests do not imply compatibility of the new public entrypoint.
@@ -1,47 +0,0 @@
1
- import * as z from 'zod/v4';
2
- declare const DeliveryRecordSchema: z.ZodObject<{
3
- blockerTimeMs: z.ZodNullable<z.ZodNumber>;
4
- cycleTimeMs: z.ZodNumber;
5
- firstPassApproved: z.ZodNullable<z.ZodBoolean>;
6
- issueNumber: z.ZodNumber;
7
- mergedAt: z.ZodISODateTime;
8
- mergeSha: z.ZodString;
9
- points: z.ZodNumber;
10
- recordedAt: z.ZodISODateTime;
11
- repository: z.ZodString;
12
- reviewRounds: z.ZodNullable<z.ZodNumber>;
13
- schemaVersion: z.ZodLiteral<"ai-delivery.delivery-record@1">;
14
- terminalCleanupAt: z.ZodISODateTime;
15
- }, z.core.$strict>;
16
- export type DeliveryRecord = z.infer<typeof DeliveryRecordSchema>;
17
- export interface PointBucketStatistics {
18
- blockerMeasurementCount: number;
19
- deliveries: number;
20
- firstPassRate: null | number;
21
- meanReviewRounds: null | number;
22
- medianBlockerTimeMs: null | number;
23
- medianCycleTimeMs: null | number;
24
- points: DeliveryRecord['points'];
25
- }
26
- export interface VelocityReport {
27
- planningCapacityPoints: number;
28
- pointBuckets: PointBucketStatistics[];
29
- rollingFourWeekMedianPoints: number;
30
- schemaVersion: 'ai-delivery.velocity-report@1';
31
- weeks: {
32
- end: string;
33
- mergedPoints: number;
34
- start: string;
35
- }[];
36
- }
37
- export declare function buildVelocityReport(records: readonly DeliveryRecord[], now?: Date, configuredPoints?: readonly number[]): VelocityReport;
38
- export declare function getDeliveryRecords(projectRoot?: string): DeliveryRecord[];
39
- export declare function recordMergedDeliveries(candidates: readonly DeliveryRecord[], projectRoot?: string): Promise<{
40
- records: DeliveryRecord[];
41
- state: 'already-recorded' | 'recorded';
42
- }>;
43
- export declare function recordMergedDelivery(candidate: DeliveryRecord, projectRoot?: string): Promise<{
44
- record: DeliveryRecord;
45
- state: 'already-recorded' | 'recorded';
46
- }>;
47
- export {};
@@ -1,199 +0,0 @@
1
- import { existsSync, readFileSync } from 'node:fs';
2
- import { join } from 'node:path';
3
- import * as z from 'zod/v4';
4
- import { gitCommonDir } from '../git.js';
5
- import { ensurePrivateDirectoryDurably, writePrivateJsonFileAtomically } from '../utils/atomicJson.js';
6
- import { DeliveryError } from '../errors.js';
7
- import { withLock } from '../utils/lockfile.js';
8
- const deliveryRecordsPath = (root) => join(gitCommonDir(root), 'ai-delivery', 'deliveries.json');
9
- const MS_PER_WEEK = 7 * 24 * 60 * 60 * 1000;
10
- const DeliveryRecordSchema = z
11
- .object({
12
- blockerTimeMs: z.number().int().nonnegative().nullable(),
13
- cycleTimeMs: z.number().int().nonnegative(),
14
- firstPassApproved: z.boolean().nullable(),
15
- issueNumber: z.number().int().positive(),
16
- mergedAt: z.iso.datetime(),
17
- mergeSha: z.string().regex(/^[0-9a-f]{40}$/u),
18
- points: z.number().int().positive().max(Number.MAX_SAFE_INTEGER),
19
- recordedAt: z.iso.datetime(),
20
- repository: z.string().regex(/^[^/\s]+\/[^/\s]+$/u),
21
- reviewRounds: z.number().int().positive().nullable(),
22
- schemaVersion: z.literal('ai-delivery.delivery-record@1'),
23
- terminalCleanupAt: z.iso.datetime(),
24
- })
25
- .strict()
26
- .superRefine((record, context) => {
27
- if (Date.parse(record.terminalCleanupAt) < Date.parse(record.mergedAt)) {
28
- context.addIssue({
29
- code: 'custom',
30
- message: 'Terminal cleanup cannot precede the merge.',
31
- path: ['terminalCleanupAt'],
32
- });
33
- }
34
- if (Date.parse(record.recordedAt) < Date.parse(record.terminalCleanupAt)) {
35
- context.addIssue({
36
- code: 'custom',
37
- message: 'Delivery recording cannot precede terminal cleanup.',
38
- path: ['recordedAt'],
39
- });
40
- }
41
- });
42
- const DeliveryRecordFileSchema = z
43
- .object({
44
- records: z.array(DeliveryRecordSchema),
45
- schemaVersion: z.literal('ai-delivery.delivery-records@1'),
46
- })
47
- .strict();
48
- export function buildVelocityReport(records, now = new Date(), configuredPoints = []) {
49
- if (!Number.isFinite(now.getTime())) {
50
- throw new DeliveryError('Velocity report requires a valid observation time.');
51
- }
52
- const endMs = now.getTime();
53
- const startMs = endMs - 4 * MS_PER_WEEK;
54
- const selected = records.filter((record) => {
55
- const mergedMs = Date.parse(record.mergedAt);
56
- return mergedMs >= startMs && mergedMs < endMs;
57
- });
58
- const weeks = Array.from({ length: 4 }, (_, index) => {
59
- const weekStart = startMs + index * MS_PER_WEEK;
60
- const weekEnd = weekStart + MS_PER_WEEK;
61
- return {
62
- end: new Date(weekEnd).toISOString(),
63
- mergedPoints: selected
64
- .filter((record) => {
65
- const mergedMs = Date.parse(record.mergedAt);
66
- return mergedMs >= weekStart && mergedMs < weekEnd;
67
- })
68
- .reduce((sum, record) => sum + record.points, 0),
69
- start: new Date(weekStart).toISOString(),
70
- };
71
- });
72
- const rollingFourWeekMedianPoints = median(weeks.map((week) => week.mergedPoints)) ?? 0;
73
- return {
74
- planningCapacityPoints: Math.floor(rollingFourWeekMedianPoints * 0.8),
75
- pointBuckets: [...new Set([...configuredPoints, ...selected.map((record) => record.points)])]
76
- .sort((left, right) => left - right)
77
- .map((points) => pointBucket(points, selected)),
78
- rollingFourWeekMedianPoints,
79
- schemaVersion: 'ai-delivery.velocity-report@1',
80
- weeks,
81
- };
82
- }
83
- export function getDeliveryRecords(projectRoot = process.cwd()) {
84
- const path = deliveryRecordsPath(projectRoot);
85
- if (!existsSync(path)) {
86
- return [];
87
- }
88
- try {
89
- return DeliveryRecordFileSchema.parse(JSON.parse(readFileSync(path, 'utf8'))).records;
90
- }
91
- catch (error) {
92
- throw new DeliveryError(`Delivery record store is invalid: ${error instanceof Error ? error.message : String(error)}`);
93
- }
94
- }
95
- export async function recordMergedDeliveries(candidates, projectRoot = process.cwd()) {
96
- if (candidates.length === 0) {
97
- throw new DeliveryError('Delivery recording requires at least one merged delivery.');
98
- }
99
- const candidateRecords = candidates.map((candidate) => DeliveryRecordSchema.parse(candidate));
100
- ensurePrivateDirectoryDurably(join(gitCommonDir(projectRoot), 'ai-delivery'));
101
- return await withLock(join(gitCommonDir(projectRoot), 'ai-delivery'), {
102
- operation: () => {
103
- const records = getDeliveryRecords(projectRoot);
104
- const pending = [];
105
- for (const candidate of candidateRecords) {
106
- const existing = [...records, ...pending].find((value) => sameDeliveryIdentity(value, candidate));
107
- if (existing !== undefined && !sameImmutableFacts(existing, candidate)) {
108
- throw new DeliveryError('Delivery facts conflict with the existing immutable delivery record.');
109
- }
110
- if (existing === undefined) {
111
- pending.push(candidate);
112
- }
113
- }
114
- if (pending.length > 0) {
115
- writePrivateJsonFileAtomically(deliveryRecordsPath(projectRoot), {
116
- records: [...records, ...pending].sort(compareDeliveryRecords),
117
- schemaVersion: 'ai-delivery.delivery-records@1',
118
- });
119
- }
120
- const readback = getDeliveryRecords(projectRoot);
121
- const persisted = candidateRecords.map((candidate) => {
122
- const match = readback.find((value) => sameDeliveryIdentity(value, candidate));
123
- if (match === undefined || !sameImmutableFacts(match, candidate)) {
124
- throw new DeliveryError('Delivery record readback did not match the merged delivery.');
125
- }
126
- return match;
127
- });
128
- return {
129
- records: persisted,
130
- state: pending.length === 0 ? 'already-recorded' : 'recorded',
131
- };
132
- },
133
- projectRoot,
134
- timeout: 5000,
135
- });
136
- }
137
- export async function recordMergedDelivery(candidate, projectRoot = process.cwd()) {
138
- const result = await recordMergedDeliveries([candidate], projectRoot);
139
- const [record] = result.records;
140
- if (record === undefined) {
141
- throw new DeliveryError('Delivery record batch did not return the merged delivery.');
142
- }
143
- return { record, state: result.state };
144
- }
145
- function compareDeliveryRecords(left, right) {
146
- return (left.repository.localeCompare(right.repository) ||
147
- left.issueNumber - right.issueNumber ||
148
- left.mergeSha.localeCompare(right.mergeSha));
149
- }
150
- function median(values) {
151
- if (values.length === 0) {
152
- return null;
153
- }
154
- const sorted = [...values].sort((left, right) => left - right);
155
- const middle = Math.floor(sorted.length / 2);
156
- const upper = sorted[middle];
157
- if (upper === undefined) {
158
- return null;
159
- }
160
- if (sorted.length % 2 === 1) {
161
- return upper;
162
- }
163
- const lower = sorted[middle - 1];
164
- return lower === undefined ? upper : (lower + upper) / 2;
165
- }
166
- function pointBucket(points, records) {
167
- const matches = records.filter((record) => record.points === points);
168
- const blockerMeasurements = matches.flatMap((record) => record.blockerTimeMs === null ? [] : [record.blockerTimeMs]);
169
- const firstPassMeasurements = matches.filter((record) => record.firstPassApproved !== null);
170
- const reviewMeasurements = matches.flatMap((record) => (record.reviewRounds === null ? [] : [record.reviewRounds]));
171
- return {
172
- blockerMeasurementCount: blockerMeasurements.length,
173
- deliveries: matches.length,
174
- firstPassRate: firstPassMeasurements.length === 0
175
- ? null
176
- : firstPassMeasurements.filter((record) => record.firstPassApproved).length / firstPassMeasurements.length,
177
- meanReviewRounds: reviewMeasurements.length === 0
178
- ? null
179
- : reviewMeasurements.reduce((sum, rounds) => sum + rounds, 0) / reviewMeasurements.length,
180
- medianBlockerTimeMs: median(blockerMeasurements),
181
- medianCycleTimeMs: median(matches.map((record) => record.cycleTimeMs)),
182
- points,
183
- };
184
- }
185
- function sameDeliveryIdentity(left, right) {
186
- return (left.repository === right.repository && left.issueNumber === right.issueNumber && left.mergeSha === right.mergeSha);
187
- }
188
- function sameImmutableFacts(left, right) {
189
- return (left.blockerTimeMs === right.blockerTimeMs &&
190
- left.cycleTimeMs === right.cycleTimeMs &&
191
- left.firstPassApproved === right.firstPassApproved &&
192
- left.issueNumber === right.issueNumber &&
193
- left.mergeSha === right.mergeSha &&
194
- left.mergedAt === right.mergedAt &&
195
- left.points === right.points &&
196
- left.repository === right.repository &&
197
- left.reviewRounds === right.reviewRounds);
198
- }
199
- //# sourceMappingURL=deliveryRecordService.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"deliveryRecordService.js","sourceRoot":"","sources":["../../src/services/deliveryRecordService.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,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