@telora/daemon 0.24.2 → 0.24.5
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/build-info.json +8 -3
- package/dist/backends/claude/one-shot-model.d.ts.map +1 -1
- package/dist/backends/claude/one-shot-model.js +2 -0
- package/dist/backends/claude/one-shot-model.js.map +1 -1
- package/dist/ci/ci-status.d.ts.map +1 -1
- package/dist/ci/ci-status.js +1 -0
- package/dist/ci/ci-status.js.map +1 -1
- package/dist/ci/product-ci-repo.d.ts.map +1 -1
- package/dist/ci/product-ci-repo.js +3 -1
- package/dist/ci/product-ci-repo.js.map +1 -1
- package/dist/completion/state-cascade/review-approved-head-gate.d.ts.map +1 -1
- package/dist/completion/state-cascade/review-approved-head-gate.js +2 -0
- package/dist/completion/state-cascade/review-approved-head-gate.js.map +1 -1
- package/dist/completion/state-cascade/review-capture-head-gate.d.ts +28 -0
- package/dist/completion/state-cascade/review-capture-head-gate.d.ts.map +1 -0
- package/dist/completion/state-cascade/review-capture-head-gate.js +48 -0
- package/dist/completion/state-cascade/review-capture-head-gate.js.map +1 -0
- package/dist/completion/state-cascade/state-cascade.d.ts +12 -0
- package/dist/completion/state-cascade/state-cascade.d.ts.map +1 -1
- package/dist/completion/state-cascade/state-cascade.js +19 -10
- package/dist/completion/state-cascade/state-cascade.js.map +1 -1
- package/dist/composition/daemon-contexts.d.ts.map +1 -1
- package/dist/composition/daemon-contexts.js +3 -1
- package/dist/composition/daemon-contexts.js.map +1 -1
- package/dist/composition/execution-git-context.d.ts.map +1 -1
- package/dist/composition/execution-git-context.js +1 -0
- package/dist/composition/execution-git-context.js.map +1 -1
- package/dist/composition/execution-worktree-context.js +1 -1
- package/dist/composition/release-note-pass-context.d.ts +7 -0
- package/dist/composition/release-note-pass-context.d.ts.map +1 -0
- package/dist/composition/release-note-pass-context.js +64 -0
- package/dist/composition/release-note-pass-context.js.map +1 -0
- package/dist/composition/runtime-contexts.d.ts.map +1 -1
- package/dist/composition/runtime-contexts.js +2 -0
- package/dist/composition/runtime-contexts.js.map +1 -1
- package/dist/composition/spawn-pass-deps.d.ts +2 -2
- package/dist/composition/spawn-pass-deps.d.ts.map +1 -1
- package/dist/composition/spawn-pass-deps.js +3 -1
- package/dist/composition/spawn-pass-deps.js.map +1 -1
- package/dist/composition/state-cascade-context.d.ts.map +1 -1
- package/dist/composition/state-cascade-context.js +2 -0
- package/dist/composition/state-cascade-context.js.map +1 -1
- package/dist/config/live-daemon-config.js +1 -1
- package/dist/daemon-state/provider-window.d.ts.map +1 -1
- package/dist/daemon-state/provider-window.js +1 -0
- package/dist/daemon-state/provider-window.js.map +1 -1
- package/dist/directive/directive-queue.js +1 -1
- package/dist/focus/daemon-contexts.d.ts +3 -0
- package/dist/focus/daemon-contexts.d.ts.map +1 -1
- package/dist/focus/daemon-contexts.js.map +1 -1
- package/dist/focus/focus-loop-registry.d.ts.map +1 -1
- package/dist/focus/focus-loop-registry.js +21 -0
- package/dist/focus/focus-loop-registry.js.map +1 -1
- package/dist/focus/pending-review-approved-head.d.ts +5 -1
- package/dist/focus/pending-review-approved-head.d.ts.map +1 -1
- package/dist/focus/pending-review-approved-head.js +35 -1
- package/dist/focus/pending-review-approved-head.js.map +1 -1
- package/dist/focus/review-spawn-coverage.d.ts +11 -0
- package/dist/focus/review-spawn-coverage.d.ts.map +1 -1
- package/dist/focus/review-spawn-coverage.js +14 -0
- package/dist/focus/review-spawn-coverage.js.map +1 -1
- package/dist/git/delivery-trailer.d.ts.map +1 -1
- package/dist/git/delivery-trailer.js +2 -0
- package/dist/git/delivery-trailer.js.map +1 -1
- package/dist/git/utils.d.ts.map +1 -1
- package/dist/git/utils.js +2 -1
- package/dist/git/utils.js.map +1 -1
- package/dist/merge/candidate-rework.d.ts.map +1 -1
- package/dist/merge/candidate-rework.js +24 -2
- package/dist/merge/candidate-rework.js.map +1 -1
- package/dist/merge/completion-merge-activity.d.ts.map +1 -1
- package/dist/merge/completion-merge-activity.js +7 -1
- package/dist/merge/completion-merge-activity.js.map +1 -1
- package/dist/merge/completion-merge-driver.d.ts +15 -5
- package/dist/merge/completion-merge-driver.d.ts.map +1 -1
- package/dist/merge/completion-merge-driver.js +7 -2
- package/dist/merge/completion-merge-driver.js.map +1 -1
- package/dist/merge/completion-merge-gate.d.ts +5 -1
- package/dist/merge/completion-merge-gate.d.ts.map +1 -1
- package/dist/merge/completion-merge-gate.js +23 -7
- package/dist/merge/completion-merge-gate.js.map +1 -1
- package/dist/merge/merge-back-loop.d.ts.map +1 -1
- package/dist/merge/merge-back-loop.js +2 -1
- package/dist/merge/merge-back-loop.js.map +1 -1
- package/dist/merge/merge-gate-coverage.d.ts +0 -2
- package/dist/merge/merge-gate-coverage.d.ts.map +1 -1
- package/dist/merge/merge-gate-coverage.js +11 -9
- package/dist/merge/merge-gate-coverage.js.map +1 -1
- package/dist/prompt-sections/release-note-faithfulness-section.d.ts +28 -0
- package/dist/prompt-sections/release-note-faithfulness-section.d.ts.map +1 -0
- package/dist/prompt-sections/release-note-faithfulness-section.js +99 -0
- package/dist/prompt-sections/release-note-faithfulness-section.js.map +1 -0
- package/dist/prompt-sections/release-note-section.d.ts +58 -0
- package/dist/prompt-sections/release-note-section.d.ts.map +1 -0
- package/dist/prompt-sections/release-note-section.js +285 -0
- package/dist/prompt-sections/release-note-section.js.map +1 -0
- package/dist/queries/api-client/shared.d.ts +1 -0
- package/dist/queries/api-client/shared.d.ts.map +1 -1
- package/dist/queries/api-client/shared.js +16 -1
- package/dist/queries/api-client/shared.js.map +1 -1
- package/dist/queries/release-notes/release-notes.d.ts +242 -0
- package/dist/queries/release-notes/release-notes.d.ts.map +1 -0
- package/dist/queries/release-notes/release-notes.js +148 -0
- package/dist/queries/release-notes/release-notes.js.map +1 -0
- package/dist/release-notes/release-note-author.d.ts +56 -0
- package/dist/release-notes/release-note-author.d.ts.map +1 -0
- package/dist/release-notes/release-note-author.js +107 -0
- package/dist/release-notes/release-note-author.js.map +1 -0
- package/dist/release-notes/release-note-faithfulness.d.ts +40 -0
- package/dist/release-notes/release-note-faithfulness.d.ts.map +1 -0
- package/dist/release-notes/release-note-faithfulness.js +107 -0
- package/dist/release-notes/release-note-faithfulness.js.map +1 -0
- package/dist/release-notes/release-note-pass.d.ts +77 -0
- package/dist/release-notes/release-note-pass.d.ts.map +1 -0
- package/dist/release-notes/release-note-pass.js +201 -0
- package/dist/release-notes/release-note-pass.js.map +1 -0
- package/dist/testing/fixtures/api-client.js +1 -1
- package/dist/testing/fixtures/approved-head-inert-deps.d.ts +4 -3
- package/dist/testing/fixtures/approved-head-inert-deps.d.ts.map +1 -1
- package/dist/testing/fixtures/approved-head-inert-deps.js +3 -0
- package/dist/testing/fixtures/approved-head-inert-deps.js.map +1 -1
- package/dist/testing/fixtures/completion-judge-stubs.d.ts.map +1 -1
- package/dist/testing/fixtures/completion-judge-stubs.js +2 -0
- package/dist/testing/fixtures/completion-judge-stubs.js.map +1 -1
- package/dist/testing/fixtures/index.js +1 -1
- package/dist/testing/fixtures/pending-spawn-world.d.ts.map +1 -1
- package/dist/testing/fixtures/pending-spawn-world.js +1 -0
- package/dist/testing/fixtures/pending-spawn-world.js.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/worktree/capture-head-adoption.d.ts +44 -0
- package/dist/worktree/capture-head-adoption.d.ts.map +1 -0
- package/dist/worktree/capture-head-adoption.js +96 -0
- package/dist/worktree/capture-head-adoption.js.map +1 -0
- package/dist/worktree/safety.d.ts +12 -3
- package/dist/worktree/safety.d.ts.map +1 -1
- package/dist/worktree/safety.js +15 -3
- package/dist/worktree/safety.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
+
// Pinned by: packages/daemon/src/prompt-sections/release-note-section.test.ts,
|
|
3
|
+
// packages/daemon/src/release-notes/release-note-author.test.ts
|
|
4
|
+
// PINNED-BY-END
|
|
5
|
+
/**
|
|
6
|
+
* The release-note prompt: what the pass that drafts a release's note is told,
|
|
7
|
+
* once a human has cut the release (release-notes/release-note-pass.ts runs it).
|
|
8
|
+
*
|
|
9
|
+
* The note is for the product's USERS -- not its operators, not its engineers
|
|
10
|
+
* -- so the prompt hands over every piece of the release's work in its own
|
|
11
|
+
* engineering words and asks for the change each makes for a user, in a
|
|
12
|
+
* user's words. Every internal name the work was tracked under is listed as
|
|
13
|
+
* one never to repeat, and the work's id is offered for one field only
|
|
14
|
+
* (`sources`, which no reader sees).
|
|
15
|
+
*
|
|
16
|
+
* Where each item's Why comes from is stated per piece of work: the requests
|
|
17
|
+
* users raised about it (its radar blips and themes, which the list shows),
|
|
18
|
+
* else the problem the work states (its description, acceptance criteria or
|
|
19
|
+
* focus's description). The Why says THAT source in the reader's terms and in
|
|
20
|
+
* its sense. Whether it does is judged by the drafting pass's model check
|
|
21
|
+
* (release-notes/release-note-faithfulness.ts), which sends an unfaithful Why
|
|
22
|
+
* back with the one corrective attempt; the edge refuses only a Why that turns
|
|
23
|
+
* its source around by adding or dropping a negation
|
|
24
|
+
* (release-why-grounding.ts checkWhyGrounded, which a human's edit is held to
|
|
25
|
+
* as well). An acceptance criterion is restated as not having held.
|
|
26
|
+
* How to use it may only be one of the links listed for the item's work -- the
|
|
27
|
+
* release environment's address joined to a QA case path -- and an item whose
|
|
28
|
+
* work lists a link MUST use one; No action needed is for an item none of whose
|
|
29
|
+
* work lists one. A release whose environment has no address offers no links,
|
|
30
|
+
* and the prompt says so. A listed internal name of two or more words may not
|
|
31
|
+
* appear anywhere as that phrase (rephrased in the user's words; its words on
|
|
32
|
+
* their own are fine), and no one-word name may be a headline or a link label.
|
|
33
|
+
*
|
|
34
|
+
* The format and the faithfulness rules are the edge's
|
|
35
|
+
* (src/lib/releases/release-note-format.ts, release-drafting.ts
|
|
36
|
+
* checkReleaseNoteFaithful): a draft it refuses is re-asked ONCE with
|
|
37
|
+
* buildReleaseNoteCorrection appended. The output contract (one fenced json
|
|
38
|
+
* block, last in the answer) is parsed by release-notes/release-note-author.ts;
|
|
39
|
+
* the answer's shape is shown as RELEASE_NOTE_EXAMPLE, a complete note in the
|
|
40
|
+
* one format -- the SAME object as
|
|
41
|
+
* src/lib/releases/__fixtures__/release-note-prompt-example.json, which the
|
|
42
|
+
* canonical parseReleaseNote is run over (release-note-prompt-example.test.ts).
|
|
43
|
+
* Pure: the same context gives the same text.
|
|
44
|
+
*/
|
|
45
|
+
import { WORK_FACING } from '@telora/daemon-core';
|
|
46
|
+
/** The system prompt every release-note call runs under. */
|
|
47
|
+
export const RELEASE_NOTE_SYSTEM_PROMPT = 'You write release notes for the USERS of a software product -- the people who use it, not the people who build ' +
|
|
48
|
+
'or operate it. You say what users can now do, in their words. You never edit files and never run a command. You ' +
|
|
49
|
+
'end every answer with exactly one fenced json block.';
|
|
50
|
+
/** The heading the prompt opens with -- the anchor tests and logs name it by. */
|
|
51
|
+
export const RELEASE_NOTE_HEADING = '# WRITE THE RELEASE NOTE FOR THIS RELEASE';
|
|
52
|
+
/** The heading a corrective attempt's addition opens with. */
|
|
53
|
+
export const RELEASE_NOTE_CORRECTION_HEADING = '## YOUR PREVIOUS NOTE WAS REFUSED';
|
|
54
|
+
/** The audience line: who the note is for, said once, plainly. */
|
|
55
|
+
export const RELEASE_NOTE_AUDIENCE_LINE = 'The AUDIENCE is the product\'s USERS -- the people who use it. Not its operators, not its engineers, not the team ' +
|
|
56
|
+
'that built it.';
|
|
57
|
+
/** What a piece of work with no radar link writes its Why from. */
|
|
58
|
+
export const STATED_PROBLEM_WHY_LINE = 'No radar link: write the Why FROM the problem the work states -- its description, its acceptance criteria, or ' +
|
|
59
|
+
'its focus\'s description -- in the reader\'s terms. Only when none of those is written, say what its title is ' +
|
|
60
|
+
'for, never the title itself. Keep its SENSE: never say the opposite (a problem that happens is not "no longer" ' +
|
|
61
|
+
'happening); an acceptance criterion says what must HOLD, so write that it did not hold, or that users needed it.';
|
|
62
|
+
/** What a piece of work with radar links writes its Why from. */
|
|
63
|
+
export const RADAR_WHY_LINE = 'Users raised this -- write the Why FROM it: say one of the requests below in the reader\'s terms, not the ' +
|
|
64
|
+
'engineering description. Keep its SENSE: where it says users cannot / do not / have no ..., the Why says so too ' +
|
|
65
|
+
'("could not", "had no way to"); where it says something happens or users can do something, the Why never ' +
|
|
66
|
+
'negates it ("no longer", "can ... already") -- or say it as what users asked for ("Creators asked to ..."). ' +
|
|
67
|
+
'(A request whose title says little: say its assessment.)';
|
|
68
|
+
/** The rule every Why is held to: it states its work's source, in the sense it was written. */
|
|
69
|
+
export const WHY_FROM_SOURCE_RULE = '- `why`: the problem or request it addresses, from the user\'s side, written FROM its work\'s source: a request ' +
|
|
70
|
+
'the work lists (its radar blips or themes -- what users raised) or, where it lists none, the problem the work ' +
|
|
71
|
+
'states. Say THAT request or problem -- not a couple of its words, not a different problem, not the change itself: ' +
|
|
72
|
+
'a check reads every Why against its source and sends back one that does not state it. Keep it in the SENSE it ' +
|
|
73
|
+
'was written: a Why that says the OPPOSITE -- adding or dropping a not / no / never / cannot -- is refused (users ' +
|
|
74
|
+
'who cannot reconcile payouts are not users who can). Put the not with the words it negates, in the same clause ' +
|
|
75
|
+
'("could not reconcile payouts"), and never say them elsewhere without it ("cannot reconcile invoices, but can ' +
|
|
76
|
+
'reconcile payouts" is refused); or say it as what users asked for. An acceptance criterion says what must hold, ' +
|
|
77
|
+
'so its Why says it did not hold.';
|
|
78
|
+
/** The rule every How to use it is held to: a listed link whenever the work lists one. */
|
|
79
|
+
export const LINK_REQUIRED_RULE = '- `howToUse`: ONLY one of the links listed for that item\'s work -- choose the one that opens the change -- as ' +
|
|
80
|
+
'`{"label": "<what it opens, in a user\'s words>", "url": "<the url exactly as listed>"}`. When ANY of the item\'s ' +
|
|
81
|
+
'work lists a link, the item MUST use one of them; `{"noActionNeeded": true}` is ONLY for an item none of whose ' +
|
|
82
|
+
'work lists a link. Never write a url that is not listed.';
|
|
83
|
+
/** The rule a listed internal name is held to: a phrase nowhere, a single word never as a whole text. */
|
|
84
|
+
export const INTERNAL_NAME_PHRASE_RULE = 'A listed name of TWO or more words may not appear ANYWHERE in the note as that phrase -- not in a headline, a ' +
|
|
85
|
+
'sentence or a link label, whatever its case or punctuation: rephrase it in the user\'s words (its words on their ' +
|
|
86
|
+
'own are fine -- for "PDF totals", write "the totals on your PDF"). A ONE-word name is never a headline, a link ' +
|
|
87
|
+
'label or the whole of any text: write what a user can do instead.';
|
|
88
|
+
/**
|
|
89
|
+
* The answer's shape, shown as a complete note in the one release-note format
|
|
90
|
+
* for ANOTHER product. Pinned: it deep-equals
|
|
91
|
+
* src/lib/releases/__fixtures__/release-note-prompt-example.json, which the
|
|
92
|
+
* canonical parseReleaseNote accepts.
|
|
93
|
+
*/
|
|
94
|
+
export const RELEASE_NOTE_EXAMPLE = {
|
|
95
|
+
title: { product: 'Ledgerly', release: '3.2', date: '2026-01-15' },
|
|
96
|
+
summary: 'You can now download your invoices as a spreadsheet. Searching by email finds the right customer again.',
|
|
97
|
+
items: [
|
|
98
|
+
{
|
|
99
|
+
section: 'new',
|
|
100
|
+
headline: 'Download your invoices as a spreadsheet',
|
|
101
|
+
whatChanged: 'The Invoices page has a Download button that saves the invoices you see as a CSV file.',
|
|
102
|
+
why: 'Bookkeepers asked to bring invoices into their own accounting tools without copying them by hand.',
|
|
103
|
+
howToUse: { label: 'Open Invoices', url: 'https://app.ledgerly.example/invoices' },
|
|
104
|
+
sources: ['<work id>'],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
section: 'fixed',
|
|
108
|
+
headline: 'Search finds customers by email again',
|
|
109
|
+
whatChanged: 'Typing a customer\'s email address into search shows that customer.',
|
|
110
|
+
why: 'Searching by email showed no results, so people scrolled the whole customer list.',
|
|
111
|
+
howToUse: { noActionNeeded: true },
|
|
112
|
+
sources: ['<work id>'],
|
|
113
|
+
},
|
|
114
|
+
],
|
|
115
|
+
knownIssues: [],
|
|
116
|
+
};
|
|
117
|
+
/** What the prompt says when the release environment has no address. */
|
|
118
|
+
export const NO_ADDRESS_LINE = 'This release\'s environment has NO address, so NO links may be used: every item\'s `howToUse` is ' +
|
|
119
|
+
'`{"noActionNeeded": true}`.';
|
|
120
|
+
function fenced(text, none) {
|
|
121
|
+
const t = (text ?? '').trim();
|
|
122
|
+
return t ? ['```text', t, '```'] : [none];
|
|
123
|
+
}
|
|
124
|
+
function audienceLines(context) {
|
|
125
|
+
return [
|
|
126
|
+
RELEASE_NOTE_HEADING,
|
|
127
|
+
`${context.productName} ${context.releaseName} was released on ${context.date}. Write its release note.`,
|
|
128
|
+
'',
|
|
129
|
+
'## Who reads it',
|
|
130
|
+
RELEASE_NOTE_AUDIENCE_LINE,
|
|
131
|
+
'Write what each change lets a user DO, in the words a user would use. A user has never seen how the work was ' +
|
|
132
|
+
'tracked: they never see a focus, a delivery, an issue, a ticket, an id, a commit or a branch.',
|
|
133
|
+
];
|
|
134
|
+
}
|
|
135
|
+
function internalNameLines(context) {
|
|
136
|
+
const lines = [
|
|
137
|
+
'## Never repeat these internal names',
|
|
138
|
+
'The work below was tracked under these names. They are INTERNAL: never write any of them, or a close variant, ' +
|
|
139
|
+
'anywhere in the note. Say what changed for a user instead.',
|
|
140
|
+
];
|
|
141
|
+
const names = context.internalNames.map((n) => n.trim()).filter((n) => n.length > 0);
|
|
142
|
+
lines.push(...(names.length > 0 ? names.map((n) => `- ${JSON.stringify(n)}`) : ['(none recorded)']));
|
|
143
|
+
lines.push(INTERNAL_NAME_PHRASE_RULE, 'Never write the name or number of a focus, delivery, issue or ticket, a UUID or other id, a commit sha or a branch name.');
|
|
144
|
+
return lines;
|
|
145
|
+
}
|
|
146
|
+
function environmentLines(context) {
|
|
147
|
+
const address = context.environment.address?.trim();
|
|
148
|
+
return [
|
|
149
|
+
'## Where users reach the changes',
|
|
150
|
+
`- Environment: ${context.environment.name.trim() || '(unnamed)'}`,
|
|
151
|
+
address ? `- Address: ${address}` : '- Address: (none)',
|
|
152
|
+
address
|
|
153
|
+
? 'Each piece of work below lists the links offered for it in this environment (or says it offers none).'
|
|
154
|
+
: NO_ADDRESS_LINE,
|
|
155
|
+
];
|
|
156
|
+
}
|
|
157
|
+
function facingLine(work) {
|
|
158
|
+
if (work.workFacing === WORK_FACING.OUTWARD)
|
|
159
|
+
return '- Facing: outward (a change users meet)';
|
|
160
|
+
if (work.workFacing === WORK_FACING.INWARD)
|
|
161
|
+
return '- Facing: inward (internal work; users may notice nothing, or only that something got better)';
|
|
162
|
+
return '- Facing: not recorded';
|
|
163
|
+
}
|
|
164
|
+
function issueLines(work) {
|
|
165
|
+
if (work.issues.length === 0)
|
|
166
|
+
return [];
|
|
167
|
+
return [
|
|
168
|
+
'Its tasks and bugs (internal names -- never repeat them):',
|
|
169
|
+
...work.issues.map((i) => `- [${i.issueType?.trim() || 'Issue'}] ${i.title}`),
|
|
170
|
+
];
|
|
171
|
+
}
|
|
172
|
+
function whyLines(work) {
|
|
173
|
+
const { blips, themes } = work.radar;
|
|
174
|
+
if (blips.length === 0 && themes.length === 0)
|
|
175
|
+
return ['Why:', STATED_PROBLEM_WHY_LINE];
|
|
176
|
+
return [
|
|
177
|
+
'Why:',
|
|
178
|
+
RADAR_WHY_LINE,
|
|
179
|
+
...blips.map((b) => `- Blip "${b.title}" (${b.category}): ${b.assessment.trim() || '(no assessment)'}`),
|
|
180
|
+
...themes.map((t) => `- Theme "${t.title}": ${t.assessment.trim() || '(no assessment)'}`),
|
|
181
|
+
];
|
|
182
|
+
}
|
|
183
|
+
function linkLines(work, hasAddress) {
|
|
184
|
+
if (work.links.length === 0) {
|
|
185
|
+
return [
|
|
186
|
+
'How to use it:',
|
|
187
|
+
hasAddress
|
|
188
|
+
? 'No link is offered for this work: an item describing only this work has `{"noActionNeeded": true}`.'
|
|
189
|
+
: 'No link (the environment has no address): `{"noActionNeeded": true}`.',
|
|
190
|
+
];
|
|
191
|
+
}
|
|
192
|
+
return [
|
|
193
|
+
'How to use it -- the links offered for this work. An item describing this work MUST use one of them, EXACTLY as written:',
|
|
194
|
+
...work.links.map((l) => `- ${l.url} -- built there: ${l.built || '(not said)'}; a user sees: ${l.expected || '(not said)'}`),
|
|
195
|
+
];
|
|
196
|
+
}
|
|
197
|
+
function workLines(work, hasAddress) {
|
|
198
|
+
const lines = [
|
|
199
|
+
`### Work \`${work.deliveryId}\``,
|
|
200
|
+
`- Title (internal -- never repeat it): ${work.title}`,
|
|
201
|
+
facingLine(work),
|
|
202
|
+
];
|
|
203
|
+
if (work.focus) {
|
|
204
|
+
lines.push(`- Part of (internal -- never repeat it): ${work.focus.title}`);
|
|
205
|
+
lines.push('Its focus\'s description:', ...fenced(work.focus.description, '(none)'));
|
|
206
|
+
}
|
|
207
|
+
lines.push('Description:', ...fenced(work.description, '(none)'), 'Acceptance criteria:', ...fenced(work.acceptanceCriteria, '(none)'), ...issueLines(work), ...whyLines(work), ...linkLines(work, hasAddress));
|
|
208
|
+
return lines;
|
|
209
|
+
}
|
|
210
|
+
function allWorkLines(context) {
|
|
211
|
+
const hasAddress = Boolean(context.environment.address?.trim());
|
|
212
|
+
const lines = [
|
|
213
|
+
'## The work in this release',
|
|
214
|
+
'Each piece of work is described below in ENGINEERING terms, the way the team that built it wrote it. Its id ' +
|
|
215
|
+
'(after "Work") is for the `sources` field ONLY -- never write it in the text.',
|
|
216
|
+
];
|
|
217
|
+
for (const work of context.work)
|
|
218
|
+
lines.push('', ...workLines(work, hasAddress));
|
|
219
|
+
return lines;
|
|
220
|
+
}
|
|
221
|
+
const RULE_LINES = [
|
|
222
|
+
'## The rules',
|
|
223
|
+
'- Group the work into items by what a user experiences. One item may describe several pieces of work: list EVERY ' +
|
|
224
|
+
'one it describes in its `sources` (their ids, exactly as shown after "Work"). Work that changes nothing a user can ' +
|
|
225
|
+
'see or feel may be left out.',
|
|
226
|
+
'- `section`: "new" = something users could not do before; "improved" = something users could already do that is ' +
|
|
227
|
+
'now better; "fixed" = something that was broken and now works. Hints: a [Bug] suggests "fixed"; outward work is ' +
|
|
228
|
+
'a change users meet; inward work is often left out, or "improved" when users feel it (faster, more reliable).',
|
|
229
|
+
'- `headline`: what a user can now do, in the user\'s words. ONE line, at most 160 characters.',
|
|
230
|
+
'- `whatChanged`: 1-2 sentences on what is different for a user.',
|
|
231
|
+
WHY_FROM_SOURCE_RULE,
|
|
232
|
+
LINK_REQUIRED_RULE,
|
|
233
|
+
'- `summary`: 2-3 sentences on what this release means for its users.',
|
|
234
|
+
'- `knownIssues` (optional): limitations a user should know about, in their words; leave it empty when there are none.',
|
|
235
|
+
'- Write no internal name, id, commit or branch anywhere a user reads: a listed name of two or more words never ' +
|
|
236
|
+
'appears as that phrase, and no one-word name is a headline or a link label.',
|
|
237
|
+
'- Do not ask questions. Do not edit files. Do not run any command.',
|
|
238
|
+
];
|
|
239
|
+
function outputLines(context) {
|
|
240
|
+
const title = { product: context.productName, release: context.releaseName, date: context.date };
|
|
241
|
+
return [
|
|
242
|
+
'## Your answer',
|
|
243
|
+
'End your answer with exactly ONE fenced json block and nothing after it, in exactly the shape of this EXAMPLE -- a ' +
|
|
244
|
+
'complete note for ANOTHER product. Copy its shape and its plain voice, never its words, links or ids:',
|
|
245
|
+
'```json',
|
|
246
|
+
JSON.stringify(RELEASE_NOTE_EXAMPLE, null, 2),
|
|
247
|
+
'```',
|
|
248
|
+
`The title is the release's own -- copy it exactly: ${JSON.stringify(title)}`,
|
|
249
|
+
'Each item\'s `sources` lists the ids shown after "Work" for every piece of work it describes -- never "<work id>". ' +
|
|
250
|
+
'An item with nothing to open has `"howToUse": {"noActionNeeded": true}`. `knownIssues` is a list of short texts ' +
|
|
251
|
+
'a user should know about; leave it empty when there are none.',
|
|
252
|
+
];
|
|
253
|
+
}
|
|
254
|
+
/**
|
|
255
|
+
* The release-note prompt for one claimed release. Pure: the same context
|
|
256
|
+
* gives the same text.
|
|
257
|
+
*/
|
|
258
|
+
export function buildReleaseNotePrompt(context) {
|
|
259
|
+
const sections = [
|
|
260
|
+
audienceLines(context),
|
|
261
|
+
internalNameLines(context),
|
|
262
|
+
environmentLines(context),
|
|
263
|
+
allWorkLines(context),
|
|
264
|
+
[...RULE_LINES],
|
|
265
|
+
outputLines(context),
|
|
266
|
+
];
|
|
267
|
+
return sections.map((s) => s.join('\n')).join('\n\n') + '\n';
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* What a corrective attempt appends to the prompt: the refused note, the
|
|
271
|
+
* reasons it was refused, one per line, and the instruction to write the whole
|
|
272
|
+
* note again. Pure.
|
|
273
|
+
*/
|
|
274
|
+
export function buildReleaseNoteCorrection(violations, previous = null) {
|
|
275
|
+
const lines = [RELEASE_NOTE_CORRECTION_HEADING, 'You answered this once already.'];
|
|
276
|
+
if (previous)
|
|
277
|
+
lines.push('Your note was:', '```json', JSON.stringify(previous, null, 2), '```');
|
|
278
|
+
lines.push('It was refused for these reasons:', ...violations.map((v) => `- ${v}`), '', 'Write the WHOLE note again, fixing every one of them and following every rule above: no internal name, id or ' +
|
|
279
|
+
'commit anywhere a user reads, every item\'s `sources` naming the work it describes, every `why` stating its ' +
|
|
280
|
+
'work\'s source (a request users raised, or the problem the work states) in the sense it was written, never ' +
|
|
281
|
+
'its opposite, and every `howToUse` a link listed for that work ' +
|
|
282
|
+
'-- `{"noActionNeeded": true}` only when its work lists none. End with exactly one fenced json block.');
|
|
283
|
+
return lines.join('\n') + '\n';
|
|
284
|
+
}
|
|
285
|
+
//# sourceMappingURL=release-note-section.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-note-section.js","sourceRoot":"","sources":["../../src/prompt-sections/release-note-section.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+EAA+E;AAC/E,kEAAkE;AAClE,gBAAgB;AAEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAQlD,4DAA4D;AAC5D,MAAM,CAAC,MAAM,0BAA0B,GACrC,i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AC,gBAAgB,EAAE,SAAS,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;IAChG,KAAK,CAAC,IAAI,CACR,mCAAmC,EACnC,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC,EAClC,EAAE,EACF,+GAA+G;QAC7G,8GAA8G;QAC9G,6GAA6G;QAC7G,iEAAiE;QACjE,sGAAsG,CACzG,CAAC;IACF,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC;AACjC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/queries/api-client/shared.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAkC,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAuCrG,QAAA,MAAM,eAAe
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../../src/queries/api-client/shared.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAkC,KAAK,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAuCrG,QAAA,MAAM,eAAe;;;;;;;;;;CAwEX,CAAC;AAEX,KAAK,qBAAqB,GAAG,MAAM,OAAO,eAAe,CAAC;AAE1D;;;;;;;;;;GAUG;AACH,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,eAAe,C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M,EAAE,OAAO,CAAM,GACnC,OAAO,CAAC,CAAC,CAAC,CAEZ"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// PINNED-BY-BEGIN (generated by gen:pinned-by -- do not hand-edit; checked by lint:pinned-by)
|
|
2
|
-
// Pinned by:
|
|
2
|
+
// Pinned by: 98 tests -- run: npm run gen:pinned-by -- --list packages/daemon/src/queries/api-client/shared.ts
|
|
3
3
|
// PINNED-BY-END
|
|
4
4
|
import { CircuitBreaker, createApiClient, loadEnvConfig } from '@telora/daemon-core';
|
|
5
5
|
// ---------------------------------------------------------------------------
|
|
@@ -99,6 +99,16 @@ const circuitBreakers = {
|
|
|
99
99
|
maxCooldownMs: 300000,
|
|
100
100
|
label: 'qa',
|
|
101
101
|
}),
|
|
102
|
+
// releaseNotes: the release-note drafting pass's candidate read, claim and
|
|
103
|
+
// writes (release-notes/). Isolated for the same reason as 'qa': the pass is
|
|
104
|
+
// background work, and its failures (a refused draft included) must never
|
|
105
|
+
// open the 'polling' or 'delivery' breaker armed work runs through.
|
|
106
|
+
releaseNotes: new CircuitBreaker({
|
|
107
|
+
failureThreshold: 5,
|
|
108
|
+
cooldownMs: 60000,
|
|
109
|
+
maxCooldownMs: 300000,
|
|
110
|
+
label: 'releaseNotes',
|
|
111
|
+
}),
|
|
102
112
|
};
|
|
103
113
|
export const CONCERN_CLASS = {
|
|
104
114
|
heartbeat: 'control-plane',
|
|
@@ -109,6 +119,7 @@ export const CONCERN_CLASS = {
|
|
|
109
119
|
drift: 'control-plane',
|
|
110
120
|
tower: 'control-plane',
|
|
111
121
|
qa: 'control-plane',
|
|
122
|
+
releaseNotes: 'control-plane',
|
|
112
123
|
};
|
|
113
124
|
/**
|
|
114
125
|
* Actions that are observability/telemetry writes. They MUST resolve to an
|
|
@@ -138,6 +149,10 @@ const actionToConcern = {
|
|
|
138
149
|
// The QA-author pass (isolated breaker; see `qa` above).
|
|
139
150
|
daemon_get_qa_packet_candidates: 'qa',
|
|
140
151
|
daemon_qa_packet_write: 'qa',
|
|
152
|
+
// The release-note drafting pass (isolated breaker; see `releaseNotes` above).
|
|
153
|
+
daemon_get_release_note_candidates: 'releaseNotes',
|
|
154
|
+
daemon_release_note_claim: 'releaseNotes',
|
|
155
|
+
daemon_release_note_write: 'releaseNotes',
|
|
141
156
|
agent_role_list: 'polling',
|
|
142
157
|
daemon_get_done_deliveries: 'polling',
|
|
143
158
|
daemon_get_merge_conflict_deliveries: 'polling',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.js","sourceRoot":"","sources":["../../../src/queries/api-client/shared.ts"],"names":[],"mappings":"AAAA,8FAA8F;AAC9F,+GAA+G;AAC/G,gBAAgB;AAoBhB,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,aAAa,EAAkB,MAAM,qBAAqB,CAAC;AAErG,8EAA8E;AAC9E,+BAA+B;AAC/B,8EAA8E;AAC9E,oEAAoE;AACpE,iFAAiF;AAEjF,qCAAqC;AACrC,EAAE;AACF,wEAAwE;AACxE,+EAA+E;AAC/E,sEAAsE;AACtE,EAAE;AACF,0EAA0E;AAC1E,8EAA8E;AAC9E,qEAAqE;AACrE,EAAE;AACF,iFAAiF;AACjF,4EAA4E;AAC5E,4DAA4D;AAC5D,0EAA0E;AAC1E,2EAA2E;AAC3E,0EAA0E;AAC1E,0EAA0E;AAC1E,+EAA+E;AAC/E,EAAE;AACF,4EAA4E;AAC5E,8EAA8E;AAC9E,kFAAkF;AAClF,mFAAmF;AACnF,iFAAiF;AACjF,+EAA+E;AAC/E,sEAAsE;AACtE,EAAE;AACF,4EAA4E;AAC5E,2DAA2D;AAC3D,sEAAsE;AAEtE,MAAM,eAAe,GAAG;IACtB,SAAS,EAAE,IAAI,cAAc,CAAC;QAC5B,gBAAgB,EAAE,CAAC;QACnB,UAAU,EAAE,KAAK;QACjB,aAAa,EAAE,MAAM;QACrB,KAAK,EAAE,WAAW;KACnB,CAAC;IACF,OAAO,EAAE,IAAI,cAAc,CAAC;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AAO,SAAS,EAAE,CAAC,gBAAgB,CAAI,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;AACjE,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,MAAc,EACd,SAAkC,EAAE;IAEpC,OAAO,SAAS,EAAE,CAAC,WAAW,CAAI,MAAM,EAAE,MAAM,CAAC,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The release-note drafting pass's reads and writes (product-api
|
|
3
|
+
* daemon_get_release_note_candidates / daemon_release_note_claim /
|
|
4
|
+
* daemon_release_note_write; the edge side is
|
|
5
|
+
* supabase/functions/product-api/handlers/daemon-release-note-handlers.ts and
|
|
6
|
+
* the drafting context release-drafting.ts). All three ride the isolated
|
|
7
|
+
* `releaseNotes` circuit breaker, so a failing drafting pass never opens a
|
|
8
|
+
* breaker armed work reads or writes through.
|
|
9
|
+
*
|
|
10
|
+
* A claim answers the DRAFTING CONTEXT: every piece of work the release
|
|
11
|
+
* carries, in its own engineering words (the source material, and the internal
|
|
12
|
+
* names the note must not repeat), the radar blips and themes that informed it,
|
|
13
|
+
* and the links a user reaches it by in the release's environment.
|
|
14
|
+
*
|
|
15
|
+
* Every outcome is written under the claim it was made with. A draft the edge
|
|
16
|
+
* refuses comes back as an ApiError: HTTP 400 `validation_failed` (the note is
|
|
17
|
+
* not in the format, or not faithful) or HTTP 409 `state_conflict` (the claim
|
|
18
|
+
* was lost, or the human changed the release's work while it was drafted).
|
|
19
|
+
* readReleaseNoteWriteFailure is the one reader of those.
|
|
20
|
+
*
|
|
21
|
+
* WHAT THE DAEMON CAN READ OF A REFUSAL. The edge's 400 body carries every
|
|
22
|
+
* violation in a `violations` array, but the daemon's API transport
|
|
23
|
+
* (@telora/daemon-core createApiClient -> ApiError) keeps only the body's
|
|
24
|
+
* `error` text, the HTTP status and the `code`. The refusal's violations are
|
|
25
|
+
* therefore read from the error TEXT, verbatim, as one entry -- whatever the
|
|
26
|
+
* edge writes there is what the corrective attempt is shown.
|
|
27
|
+
*/
|
|
28
|
+
import { z } from 'zod';
|
|
29
|
+
declare const ReleaseNoteCandidateSchema: z.ZodObject<{
|
|
30
|
+
releaseId: z.ZodString;
|
|
31
|
+
productId: z.ZodString;
|
|
32
|
+
name: z.ZodString;
|
|
33
|
+
cutAt: z.ZodString;
|
|
34
|
+
}, z.core.$loose>;
|
|
35
|
+
/** A release still drafting that no live pass holds. */
|
|
36
|
+
export type ReleaseNoteCandidate = z.infer<typeof ReleaseNoteCandidateSchema>;
|
|
37
|
+
declare const DraftingWorkSchema: z.ZodObject<{
|
|
38
|
+
deliveryId: z.ZodString;
|
|
39
|
+
title: z.ZodString;
|
|
40
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
41
|
+
acceptanceCriteria: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
42
|
+
workFacing: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
43
|
+
focus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
44
|
+
focusId: z.ZodString;
|
|
45
|
+
title: z.ZodString;
|
|
46
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
47
|
+
}, z.core.$loose>>>>;
|
|
48
|
+
issues: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
49
|
+
title: z.ZodString;
|
|
50
|
+
issueType: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
51
|
+
}, z.core.$loose>>>>;
|
|
52
|
+
radar: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
53
|
+
blips: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
54
|
+
title: z.ZodString;
|
|
55
|
+
category: z.ZodString;
|
|
56
|
+
assessment: z.ZodString;
|
|
57
|
+
}, z.core.$loose>>>>;
|
|
58
|
+
themes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
title: z.ZodString;
|
|
60
|
+
assessment: z.ZodString;
|
|
61
|
+
}, z.core.$loose>>>>;
|
|
62
|
+
}, z.core.$loose>>>;
|
|
63
|
+
links: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
64
|
+
url: z.ZodString;
|
|
65
|
+
built: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
66
|
+
criterion: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
67
|
+
expected: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
68
|
+
}, z.core.$loose>>>>;
|
|
69
|
+
}, z.core.$loose>;
|
|
70
|
+
/** One piece of work a release carries, as the note is drafted from it. */
|
|
71
|
+
export type DraftingWork = z.infer<typeof DraftingWorkSchema>;
|
|
72
|
+
declare const DraftingContextSchema: z.ZodObject<{
|
|
73
|
+
releaseId: z.ZodString;
|
|
74
|
+
productId: z.ZodString;
|
|
75
|
+
productName: z.ZodString;
|
|
76
|
+
releaseName: z.ZodString;
|
|
77
|
+
date: z.ZodString;
|
|
78
|
+
environment: z.ZodObject<{
|
|
79
|
+
name: z.ZodString;
|
|
80
|
+
address: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
81
|
+
}, z.core.$loose>;
|
|
82
|
+
work: z.ZodArray<z.ZodObject<{
|
|
83
|
+
deliveryId: z.ZodString;
|
|
84
|
+
title: z.ZodString;
|
|
85
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
86
|
+
acceptanceCriteria: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
87
|
+
workFacing: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
88
|
+
focus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
89
|
+
focusId: z.ZodString;
|
|
90
|
+
title: z.ZodString;
|
|
91
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
92
|
+
}, z.core.$loose>>>>;
|
|
93
|
+
issues: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
94
|
+
title: z.ZodString;
|
|
95
|
+
issueType: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
96
|
+
}, z.core.$loose>>>>;
|
|
97
|
+
radar: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
98
|
+
blips: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
99
|
+
title: z.ZodString;
|
|
100
|
+
category: z.ZodString;
|
|
101
|
+
assessment: z.ZodString;
|
|
102
|
+
}, z.core.$loose>>>>;
|
|
103
|
+
themes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
title: z.ZodString;
|
|
105
|
+
assessment: z.ZodString;
|
|
106
|
+
}, z.core.$loose>>>>;
|
|
107
|
+
}, z.core.$loose>>>;
|
|
108
|
+
links: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
109
|
+
url: z.ZodString;
|
|
110
|
+
built: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
111
|
+
criterion: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
112
|
+
expected: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
113
|
+
}, z.core.$loose>>>>;
|
|
114
|
+
}, z.core.$loose>>;
|
|
115
|
+
internalNames: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
116
|
+
}, z.core.$loose>;
|
|
117
|
+
/** Everything a release's note is drafted from. */
|
|
118
|
+
export type DraftingContext = z.infer<typeof DraftingContextSchema>;
|
|
119
|
+
declare const ReleaseNoteClaimSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
120
|
+
claimed: z.ZodLiteral<false>;
|
|
121
|
+
reason: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
122
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
123
|
+
claimed: z.ZodLiteral<true>;
|
|
124
|
+
claimId: z.ZodString;
|
|
125
|
+
context: z.ZodObject<{
|
|
126
|
+
releaseId: z.ZodString;
|
|
127
|
+
productId: z.ZodString;
|
|
128
|
+
productName: z.ZodString;
|
|
129
|
+
releaseName: z.ZodString;
|
|
130
|
+
date: z.ZodString;
|
|
131
|
+
environment: z.ZodObject<{
|
|
132
|
+
name: z.ZodString;
|
|
133
|
+
address: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
134
|
+
}, z.core.$loose>;
|
|
135
|
+
work: z.ZodArray<z.ZodObject<{
|
|
136
|
+
deliveryId: z.ZodString;
|
|
137
|
+
title: z.ZodString;
|
|
138
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
139
|
+
acceptanceCriteria: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
140
|
+
workFacing: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
141
|
+
focus: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
142
|
+
focusId: z.ZodString;
|
|
143
|
+
title: z.ZodString;
|
|
144
|
+
description: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
145
|
+
}, z.core.$loose>>>>;
|
|
146
|
+
issues: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
147
|
+
title: z.ZodString;
|
|
148
|
+
issueType: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodString>>>;
|
|
149
|
+
}, z.core.$loose>>>>;
|
|
150
|
+
radar: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
151
|
+
blips: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
152
|
+
title: z.ZodString;
|
|
153
|
+
category: z.ZodString;
|
|
154
|
+
assessment: z.ZodString;
|
|
155
|
+
}, z.core.$loose>>>>;
|
|
156
|
+
themes: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
157
|
+
title: z.ZodString;
|
|
158
|
+
assessment: z.ZodString;
|
|
159
|
+
}, z.core.$loose>>>>;
|
|
160
|
+
}, z.core.$loose>>>;
|
|
161
|
+
links: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
162
|
+
url: z.ZodString;
|
|
163
|
+
built: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
164
|
+
criterion: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
165
|
+
expected: z.ZodDefault<z.ZodOptional<z.ZodString>>;
|
|
166
|
+
}, z.core.$loose>>>>;
|
|
167
|
+
}, z.core.$loose>>;
|
|
168
|
+
internalNames: z.ZodDefault<z.ZodOptional<z.ZodArray<z.ZodString>>>;
|
|
169
|
+
}, z.core.$loose>;
|
|
170
|
+
}, z.core.$loose>], "claimed">;
|
|
171
|
+
/** A claim's answer: the release is this pass's to draft (with what to draft it from), or it is not. */
|
|
172
|
+
export type ReleaseNoteClaim = z.infer<typeof ReleaseNoteClaimSchema>;
|
|
173
|
+
/** How to use it: a link offered for the item's work, or nothing to open. */
|
|
174
|
+
export type ReleaseNoteHowToUse = {
|
|
175
|
+
label: string;
|
|
176
|
+
url: string;
|
|
177
|
+
} | {
|
|
178
|
+
noActionNeeded: true;
|
|
179
|
+
};
|
|
180
|
+
/**
|
|
181
|
+
* A drafted note as the pass sends it. Items are kept as the model wrote them:
|
|
182
|
+
* the format (src/lib/releases/release-note-format.ts) and the faithfulness
|
|
183
|
+
* check are the edge's, and a refusal names what to fix.
|
|
184
|
+
*/
|
|
185
|
+
export interface ReleaseNoteDraft {
|
|
186
|
+
summary: string;
|
|
187
|
+
items: Array<Record<string, unknown>>;
|
|
188
|
+
knownIssues?: unknown;
|
|
189
|
+
}
|
|
190
|
+
/** One write under a claim: the draft, or the failure a human redraft retries. */
|
|
191
|
+
export type ReleaseNoteWrite = {
|
|
192
|
+
releaseId: string;
|
|
193
|
+
claimId: string;
|
|
194
|
+
outcome: 'draft';
|
|
195
|
+
note: ReleaseNoteDraft;
|
|
196
|
+
draftedFromDeliveryIds: string[];
|
|
197
|
+
} | {
|
|
198
|
+
releaseId: string;
|
|
199
|
+
claimId: string;
|
|
200
|
+
outcome: 'failed';
|
|
201
|
+
failureReason: string;
|
|
202
|
+
};
|
|
203
|
+
/** The product's releases still drafting and held by no live pass, oldest cut first (bounded by the edge). */
|
|
204
|
+
export declare function getReleaseNoteCandidates(productId: string): Promise<ReleaseNoteCandidate[]>;
|
|
205
|
+
/** Take one release to draft. Not claimed when it stopped drafting or another pass holds it. */
|
|
206
|
+
export declare function claimReleaseNote(releaseId: string): Promise<ReleaseNoteClaim>;
|
|
207
|
+
/** Write the draft or the failure under the claim. Throws on a refusal (readReleaseNoteWriteFailure reads it). */
|
|
208
|
+
export declare function writeReleaseNote(write: ReleaseNoteWrite): Promise<void>;
|
|
209
|
+
/** Give the claim back so the next tick can draft the release again; false when this pass no longer held it. */
|
|
210
|
+
export declare function unclaimReleaseNote(releaseId: string, claimId: string): Promise<boolean>;
|
|
211
|
+
/** Why a release-note write did not land. */
|
|
212
|
+
export type ReleaseNoteWriteFailure =
|
|
213
|
+
/** The edge refused the note (format or faithfulness): what it said, for the corrective attempt. */
|
|
214
|
+
{
|
|
215
|
+
kind: 'refused';
|
|
216
|
+
violations: string[];
|
|
217
|
+
}
|
|
218
|
+
/** The claim was lost, or the release's work changed while the note was drafted. */
|
|
219
|
+
| {
|
|
220
|
+
kind: 'conflict';
|
|
221
|
+
detail: string;
|
|
222
|
+
}
|
|
223
|
+
/** Anything else: transport, breaker, a server error. */
|
|
224
|
+
| {
|
|
225
|
+
kind: 'error';
|
|
226
|
+
detail: string;
|
|
227
|
+
};
|
|
228
|
+
/**
|
|
229
|
+
* The violations a refusal names. The edge writes each one into its message,
|
|
230
|
+
* one per line (the api client keeps the message, not the body), so they are
|
|
231
|
+
* read back from it; a message in any other shape is kept whole as one
|
|
232
|
+
* violation.
|
|
233
|
+
*/
|
|
234
|
+
export declare function refusalViolations(message: string): string[];
|
|
235
|
+
/**
|
|
236
|
+
* Classify what a release-note write threw, from the edge envelope's HTTP
|
|
237
|
+
* status and machine code (ApiError.statusCode / wireCode), never its prose.
|
|
238
|
+
* Total: every input yields a failure. Pure.
|
|
239
|
+
*/
|
|
240
|
+
export declare function readReleaseNoteWriteFailure(err: unknown): ReleaseNoteWriteFailure;
|
|
241
|
+
export {};
|
|
242
|
+
//# sourceMappingURL=release-notes.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"release-notes.d.ts","sourceRoot":"","sources":["../../../src/queries/release-notes/release-notes.ts"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,QAAA,MAAM,0BAA0B;;;;;iBAKhB,CAAC;AAEjB,wDAAwD;AACxD,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAc9E,QAAA,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAiBR,CAAC;AAEjB,2EAA2E;AAC3E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAE9D,QAAA,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWX,CAAC;AAEjB,mDAAmD;AACnD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AAEpE,QAAA,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;8BAG1B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