@yagni-app/code-staging 1.2.14-staging.2473.1 → 1.2.14-staging.2480.1
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/dist/crashReport.js
CHANGED
|
@@ -63,10 +63,55 @@ export function crashReportsSuppressed(env = process.env) {
|
|
|
63
63
|
// Mirrors scrubSecrets (backend yagniCode/scrubSecrets.ts and
|
|
64
64
|
// pi-extension-yagni pipeline/scrubSecrets.ts) — keep in sync.
|
|
65
65
|
export const SECRET_PATTERNS = [
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
66
|
+
// Credentials embedded in connection-string URLs: scheme://user:password@host
|
|
67
|
+
// (the password segment has no secret-named key and is usually too short for the
|
|
68
|
+
// base64 rule, so it would otherwise survive — common in config/env diffs).
|
|
69
|
+
// The user name may be empty (`redis://:pass@cache`) and the password may
|
|
70
|
+
// hold a colon (`alice:a:b@db`); scheme, user and host stay readable
|
|
71
|
+
// (YAG-1324). User info ends before a `?` or `#`, so a port followed by a
|
|
72
|
+
// query or fragment holding an `@` (`https://host:8443?x@y`) is no password.
|
|
73
|
+
[/\b([a-z][a-z0-9+.\-]*:\/\/[^\s:@/?#]*):[^\s@/?#]+@/gi, "$1:[REDACTED]@"],
|
|
74
|
+
// Whole JWTs, base64url segments of any length (`_` and `-` among them), so
|
|
75
|
+
// the long-blob rule's 40 characters is no floor (YAG-1324).
|
|
76
|
+
[/\beyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*/g, "[REDACTED]"],
|
|
77
|
+
// Credential-bearing parameters, in a URL's query or fragment or bare on a
|
|
78
|
+
// line (YAG-1324): the name stays readable, the value goes. A name is a
|
|
79
|
+
// credential when its last `-`/`_`/`.` part is one (`X-Amz-Signature`,
|
|
80
|
+
// `X-Amz-Security-Token`, `client_secret`, `access_token`), never when the
|
|
81
|
+
// word is only inside a part (`design`, `zipcode`, `author`). These match
|
|
82
|
+
// anywhere a name starts, with `=` or, as a header dump or a JSON body
|
|
83
|
+
// writes them, `:` (`X-Amz-Signature: …`, `"client_secret":"…"`). Never a
|
|
84
|
+
// path's last part (`src/auth/token:12:5`) nor a stack frame's bare `line:col`
|
|
85
|
+
// (`at async token:12:5`). Prose after the name (`token: expired.`) is
|
|
86
|
+
// redacted all the same, failing closed; a value never ends in the
|
|
87
|
+
// sentence's `.`, `,`, `;`, `:`, `!`, `?` or `)`, which stays.
|
|
88
|
+
[
|
|
89
|
+
/(?<![A-Za-z0-9_.\-/\\])((?:[A-Za-z0-9]+[_.-])*(?:token|secret|signature|password|passwd|credential|credentials)["']?\s*[:=]\s*["']?)(?!\d+:\d+(?![^\s)]))[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi,
|
|
90
|
+
"$1[REDACTED]",
|
|
91
|
+
],
|
|
92
|
+
// The short whole names (`sig`, `code`, `key`, `auth`) only behind a URL's
|
|
93
|
+
// `?`, `&`, `#` or `;`: bare, `code=1` is how a line says an exit code.
|
|
94
|
+
[/([?&#;](?:sig|code|key|auth)=)[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi, "$1[REDACTED]"],
|
|
95
|
+
// Provider key prefixes (OpenAI, Stripe secret/restricted, GitHub, Slack, AWS access key id, etc.)
|
|
96
|
+
[
|
|
97
|
+
/\b(sk-[A-Za-z0-9]{16,}|sk_(?:live|test)_[A-Za-z0-9]{16,}|rk_(?:live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_\-]{20,})\b/g,
|
|
98
|
+
"[REDACTED]",
|
|
99
|
+
],
|
|
100
|
+
// key = "value" / key: value for secret-named keys, the key quoted as JSON
|
|
101
|
+
// quotes it too (`"password":"…"`, YAG-1324). As the parameter rule above:
|
|
102
|
+
// never a path's last part nor a frame's bare `line:col` (not `12:34:56`), and an unquoted value
|
|
103
|
+
// leaves the sentence's closing punctuation.
|
|
104
|
+
[
|
|
105
|
+
/(?<![/\\])\b([A-Za-z0-9_]*(?:secret|password|passwd|api[_-]?key|token|private[_-]?key|access[_-]?key)[A-Za-z0-9_]*)\b(["']?\s*[:=]\s*)("[^"]+"|'[^']+'|`[^`]+`|(?!\d+:\d+(?![^\s)]))[^\s"']*[^\s"'.,;:!?)])/gi,
|
|
106
|
+
"$1$2[REDACTED]",
|
|
107
|
+
],
|
|
108
|
+
// Long base64-ish blobs (likely keys/JWTs)
|
|
69
109
|
[/\b[A-Za-z0-9+/]{40,}={0,2}\b/g, "[REDACTED]"],
|
|
110
|
+
// Opaque bearer tokens in Authorization headers: no provider prefix, no
|
|
111
|
+
// secret-named key, and usually under the base64 length threshold — none of
|
|
112
|
+
// the patterns above catch them. Keep the scheme, redact the token. Header
|
|
113
|
+
// names and auth schemes are case-insensitive (RFC 9110) — hence the flag.
|
|
114
|
+
[/(\bauthorization\s*[:=]\s*["']?bearer\s+)([a-z0-9._~+/=-]+)/gi, "$1[REDACTED]"],
|
|
70
115
|
];
|
|
71
116
|
const HOME_DIR_RE = /(?:\/(?:Users|home)\/|[A-Za-z]:\\Users\\)[^\s/\\]+/g;
|
|
72
117
|
/**
|
|
@@ -42,6 +42,14 @@ export declare const MAX_ASK_LINES = 8;
|
|
|
42
42
|
export declare function parseAttemptAsk(value: unknown): AttemptAsk | null;
|
|
43
43
|
/** The ask as the file holds it, or null when the file is missing, does not read or asks nothing. */
|
|
44
44
|
export declare function readNeedsPerson(text: string | null): AttemptAsk | null;
|
|
45
|
+
/**
|
|
46
|
+
* Who reads an ask, and so how it is written (YAG-1389): the customer's
|
|
47
|
+
* engineer, often from a notification, who sees neither the plan nor the
|
|
48
|
+
* review. The host's cleaner (`plainAskWords` in the backend) catches a
|
|
49
|
+
* review id or an em-dash that gets through; only this rule covers a
|
|
50
|
+
* numbered plan step.
|
|
51
|
+
*/
|
|
52
|
+
export declare const ASK_READER_RULE = "The ask is read by the customer's engineer on the yak card, often from a notification, who must be able to choose from it alone, without opening the plan or the review. So the question and the options use no ids (review thread, finding, run or plan ids) and no numbered plan steps, criteria or questions: quote or describe them in plain words instead (for example \"the ticket says no behavior change\"). Name a review comment by who asked and what they asked, never by its id or a link. The evidence stays checkable (file:line, commits and commands), with no review ids or plan numbers either. No internal labels such as needs_person, and no em-dashes.";
|
|
45
53
|
/**
|
|
46
54
|
* The build rule that says when the session stops for a person, and how. A
|
|
47
55
|
* person answers it and the session resumes with their answer.
|
|
@@ -86,13 +86,21 @@ export function readNeedsPerson(text) {
|
|
|
86
86
|
return null;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
+
/**
|
|
90
|
+
* Who reads an ask, and so how it is written (YAG-1389): the customer's
|
|
91
|
+
* engineer, often from a notification, who sees neither the plan nor the
|
|
92
|
+
* review. The host's cleaner (`plainAskWords` in the backend) catches a
|
|
93
|
+
* review id or an em-dash that gets through; only this rule covers a
|
|
94
|
+
* numbered plan step.
|
|
95
|
+
*/
|
|
96
|
+
export const ASK_READER_RULE = 'The ask is read by the customer\'s engineer on the yak card, often from a notification, who must be able to choose from it alone, without opening the plan or the review. So the question and the options use no ids (review thread, finding, run or plan ids) and no numbered plan steps, criteria or questions: quote or describe them in plain words instead (for example "the ticket says no behavior change"). Name a review comment by who asked and what they asked, never by its id or a link. The evidence stays checkable (file:line, commits and commands), with no review ids or plan numbers either. No internal labels such as needs_person, and no em-dashes.';
|
|
89
97
|
/**
|
|
90
98
|
* The build rule that says when the session stops for a person, and how. A
|
|
91
99
|
* person answers it and the session resumes with their answer.
|
|
92
100
|
*/
|
|
93
101
|
export const NEEDS_PERSON_RULE = (outDir) => `Stop and ask a person only for a change of direction: the plan or the ticket is wrong about the code, or the right change is far larger than the ticket, or a choice that cannot be undone that neither settles. Never for what a check, a read or a decision record answers. Then write ${join(outDir, NEEDS_PERSON_FILE_NAME)} as JSON: ` +
|
|
94
|
-
'{"question": "<one question a person can answer>", "evidence": ["<file:line, command or query, and what it showed>"], "options": ["<your recommendation first>", "<each other way on>"]}
|
|
95
|
-
|
|
102
|
+
'{"question": "<one question a person can answer>", "evidence": ["<file:line, command or query, and what it showed>"], "options": ["<your recommendation first>", "<each other way on>"]}. ' +
|
|
103
|
+
`${ASK_READER_RULE} Then commit what is done so far, write the report, and end your turn: YAGNI hands the ticket to a person with your ask, and you resume with their answer.`;
|
|
96
104
|
/**
|
|
97
105
|
* A writing turn's result with the session's ask folded in: a turn that
|
|
98
106
|
* ended on its own (`clean`, or `no_changes`) with an ask stops
|
|
@@ -140,10 +148,10 @@ export function sessionWorkingStyleOf(text) {
|
|
|
140
148
|
}
|
|
141
149
|
/** How a yak's ask is written and what follows it: the same shape as {@link NEEDS_PERSON_RULE}'s, with its reason. */
|
|
142
150
|
const ASK_SHAPE = (outDir) => `write ${join(outDir, NEEDS_PERSON_FILE_NAME)} as JSON: ` +
|
|
143
|
-
'{"question": "<one question a person can answer>", "reason": "<the reason\'s key>", "evidence": ["<file:line, command or query, and what it showed>"], "options": ["<your recommendation first>", "<each other way on>"]}
|
|
144
|
-
|
|
151
|
+
'{"question": "<one question a person can answer>", "reason": "<the reason\'s key>", "evidence": ["<file:line, command or query, and what it showed>"], "options": ["<your recommendation first>", "<each other way on>"]}. ' +
|
|
152
|
+
`${ASK_READER_RULE} Then commit what is done so far, write the report, and end your turn: YAGNI hands the ticket to a person with your ask, and you resume with their answer. No evidence, no stop.`;
|
|
145
153
|
/** A reviewer's item that changes the product beyond the plan, on either style. */
|
|
146
|
-
const REVIEW_ASK_RULE =
|
|
154
|
+
const REVIEW_ASK_RULE = 'A review item from a reviewer (Proctor, or any other app) that would change the product beyond the plan, not only the code, is a person\'s call: stop and ask about it, with reason "product_change" and as evidence who asked for it and what it would change, instead of marking it needs_person in the outcomes file. An item a person on the Team wrote themselves is their instruction: act on it, and never ask about it.';
|
|
147
155
|
/**
|
|
148
156
|
* A yak's build, fix or verify turn: when it may stop for a person, by the
|
|
149
157
|
* ticket's working style. Check with me stops for a change of direction, as
|
|
@@ -15,11 +15,45 @@ const PATTERNS = [
|
|
|
15
15
|
// Credentials embedded in connection-string URLs: scheme://user:password@host
|
|
16
16
|
// (the password segment has no secret-named key and is usually too short for the
|
|
17
17
|
// base64 rule, so it would otherwise survive — common in config/env diffs).
|
|
18
|
-
|
|
18
|
+
// The user name may be empty (`redis://:pass@cache`) and the password may
|
|
19
|
+
// hold a colon (`alice:a:b@db`); scheme, user and host stay readable
|
|
20
|
+
// (YAG-1324). User info ends before a `?` or `#`, so a port followed by a
|
|
21
|
+
// query or fragment holding an `@` (`https://host:8443?x@y`) is no password.
|
|
22
|
+
[/\b([a-z][a-z0-9+.\-]*:\/\/[^\s:@/?#]*):[^\s@/?#]+@/gi, "$1:[REDACTED]@"],
|
|
23
|
+
// Whole JWTs, base64url segments of any length (`_` and `-` among them), so
|
|
24
|
+
// the long-blob rule's 40 characters is no floor (YAG-1324).
|
|
25
|
+
[/\beyJ[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*/g, "[REDACTED]"],
|
|
26
|
+
// Credential-bearing parameters, in a URL's query or fragment or bare on a
|
|
27
|
+
// line (YAG-1324): the name stays readable, the value goes. A name is a
|
|
28
|
+
// credential when its last `-`/`_`/`.` part is one (`X-Amz-Signature`,
|
|
29
|
+
// `X-Amz-Security-Token`, `client_secret`, `access_token`), never when the
|
|
30
|
+
// word is only inside a part (`design`, `zipcode`, `author`). These match
|
|
31
|
+
// anywhere a name starts, with `=` or, as a header dump or a JSON body
|
|
32
|
+
// writes them, `:` (`X-Amz-Signature: …`, `"client_secret":"…"`). Never a
|
|
33
|
+
// path's last part (`src/auth/token:12:5`) nor a stack frame's bare `line:col`
|
|
34
|
+
// (`at async token:12:5`). Prose after the name (`token: expired.`) is
|
|
35
|
+
// redacted all the same, failing closed; a value never ends in the
|
|
36
|
+
// sentence's `.`, `,`, `;`, `:`, `!`, `?` or `)`, which stays.
|
|
37
|
+
[
|
|
38
|
+
/(?<![A-Za-z0-9_.\-/\\])((?:[A-Za-z0-9]+[_.-])*(?:token|secret|signature|password|passwd|credential|credentials)["']?\s*[:=]\s*["']?)(?!\d+:\d+(?![^\s)]))[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi,
|
|
39
|
+
"$1[REDACTED]",
|
|
40
|
+
],
|
|
41
|
+
// The short whole names (`sig`, `code`, `key`, `auth`) only behind a URL's
|
|
42
|
+
// `?`, `&`, `#` or `;`: bare, `code=1` is how a line says an exit code.
|
|
43
|
+
[/([?&#;](?:sig|code|key|auth)=)[^&#\s"'<>]*[^&#\s"'<>.,;:!?)]/gi, "$1[REDACTED]"],
|
|
19
44
|
// Provider key prefixes (OpenAI, Stripe secret/restricted, GitHub, Slack, AWS access key id, etc.)
|
|
20
|
-
[
|
|
21
|
-
|
|
22
|
-
|
|
45
|
+
[
|
|
46
|
+
/\b(sk-[A-Za-z0-9]{16,}|sk_(?:live|test)_[A-Za-z0-9]{16,}|rk_(?:live|test)_[A-Za-z0-9]{16,}|gh[pousr]_[A-Za-z0-9]{20,}|xox[baprs]-[A-Za-z0-9-]{10,}|AKIA[0-9A-Z]{16}|AIza[0-9A-Za-z_\-]{20,})\b/g,
|
|
47
|
+
"[REDACTED]",
|
|
48
|
+
],
|
|
49
|
+
// key = "value" / key: value for secret-named keys, the key quoted as JSON
|
|
50
|
+
// quotes it too (`"password":"…"`, YAG-1324). As the parameter rule above:
|
|
51
|
+
// never a path's last part nor a frame's bare `line:col` (not `12:34:56`), and an unquoted value
|
|
52
|
+
// leaves the sentence's closing punctuation.
|
|
53
|
+
[
|
|
54
|
+
/(?<![/\\])\b([A-Za-z0-9_]*(?:secret|password|passwd|api[_-]?key|token|private[_-]?key|access[_-]?key)[A-Za-z0-9_]*)\b(["']?\s*[:=]\s*)("[^"]+"|'[^']+'|`[^`]+`|(?!\d+:\d+(?![^\s)]))[^\s"']*[^\s"'.,;:!?)])/gi,
|
|
55
|
+
"$1$2[REDACTED]",
|
|
56
|
+
],
|
|
23
57
|
// Long base64-ish blobs (likely keys/JWTs)
|
|
24
58
|
[/\b[A-Za-z0-9+/]{40,}={0,2}\b/g, "[REDACTED]"],
|
|
25
59
|
// Opaque bearer tokens in Authorization headers: no provider prefix, no
|
|
@@ -229,7 +229,8 @@ export function systemRepositoriesOf(text, cwd) {
|
|
|
229
229
|
}
|
|
230
230
|
const SHA = /^[0-9a-f]{40}([0-9a-f]{24})?$/;
|
|
231
231
|
const REPORT_CONTRACT = (outDir) => `Last, write ${join(outDir, SESSION_REPORT_FILE_NAME)} as JSON, honestly: ` +
|
|
232
|
-
'
|
|
232
|
+
// A yak's thread shows the summary as its "Where we are" note (YAG-1389).
|
|
233
|
+
'{"summary": "<what you changed, in two or three sentences, for the customer\'s engineer who reads it on the yak card: plain words, no review, finding, run or plan ids, no numbered plan steps, criteria or questions, no outcome labels such as needs_person, and no em-dashes>", ' +
|
|
233
234
|
'"checks": [{"name": "lint", "command": "pnpm lint", "cwd": ".", "exitCode": 0, "durationMs": 41000, ' +
|
|
234
235
|
'"baseline": "runnable | fails_on_base | cannot_run"}], ' +
|
|
235
236
|
'"notVerified": ["<what you could not verify, and why>"], ' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yagni-app/code-staging",
|
|
3
|
-
"version": "1.2.14-staging.
|
|
3
|
+
"version": "1.2.14-staging.2480.1",
|
|
4
4
|
"description": "YAGNI Code: a terminal coding agent that already knows your company. One YAGNI login routes the model and grounds the agent in your team's context.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "YAGNI, Inc. <jack@yagni.app> (https://yagni.app)",
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"turndown": "^7.2.4",
|
|
59
59
|
"typebox": "^1.3.15"
|
|
60
60
|
},
|
|
61
|
-
"yagniSourceSha": "
|
|
61
|
+
"yagniSourceSha": "d63a72941834dff8696cf45c3d22a93e0f7e24c7"
|
|
62
62
|
}
|