@akasecurity/ai-tc-claude-code 0.9.1 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +3 -1
- package/commands/setup.md +101 -19
- package/package.json +3 -3
- package/scripts/apply-suppressions.js +3251 -497
- package/scripts/backfill.js +1081 -493
- package/scripts/filescan.js +1069 -487
- package/scripts/firstrun.js +981 -450
- package/scripts/intro.js +92 -24
- package/scripts/onboard.js +1006 -453
- package/scripts/post-tool-use.js +1062 -480
- package/scripts/pre-tool-use.js +1067 -485
- package/scripts/query.js +981 -450
- package/scripts/reconcile.js +1010 -473
- package/scripts/remediate.js +1072 -490
- package/scripts/session-start.js +1043 -512
- package/scripts/start-light.js +92 -24
- package/scripts/statusline.js +981 -450
- package/scripts/stop.js +133 -38
- package/scripts/triage-rubric.md +4 -3
- package/scripts/user-prompt-submit.js +1070 -488
package/scripts/stop.js
CHANGED
|
@@ -491,9 +491,13 @@ var require_ignore = __commonJS({
|
|
|
491
491
|
}
|
|
492
492
|
});
|
|
493
493
|
|
|
494
|
+
// ../../packages/plugin-sdk/src/config.ts
|
|
495
|
+
import { existsSync as existsSync4 } from "fs";
|
|
496
|
+
import { join as join6 } from "path";
|
|
497
|
+
|
|
494
498
|
// ../../packages/persistence/src/database.ts
|
|
495
499
|
import { randomUUID as randomUUID8 } from "crypto";
|
|
496
|
-
import { existsSync, renameSync, rmSync } from "fs";
|
|
500
|
+
import { existsSync, renameSync as renameSync2, rmSync as rmSync2 } from "fs";
|
|
497
501
|
import { join, sep } from "path";
|
|
498
502
|
import { DatabaseSync } from "node:sqlite";
|
|
499
503
|
|
|
@@ -15182,7 +15186,12 @@ var FindingFacets = external_exports.object({
|
|
|
15182
15186
|
severity: external_exports.array(FindingFacetItem),
|
|
15183
15187
|
subtype: external_exports.array(FindingFacetItem),
|
|
15184
15188
|
provider: external_exports.array(FindingFacetItem),
|
|
15185
|
-
action: external_exports.array(FindingFacetItem)
|
|
15189
|
+
action: external_exports.array(FindingFacetItem),
|
|
15190
|
+
// Counts by the group's derived status. The SQLite store derives a status
|
|
15191
|
+
// for every instance, so every group lands in a bucket; a status-less
|
|
15192
|
+
// group (possible only for callers whose rows carry no statuses) is
|
|
15193
|
+
// counted under no value.
|
|
15194
|
+
status: external_exports.array(FindingFacetItem)
|
|
15186
15195
|
}).meta({ id: "FindingFacets" });
|
|
15187
15196
|
var ListGroupedFindingsQuery = external_exports.object({
|
|
15188
15197
|
// NOTE: severity filters by Severity (critical/high/medium/low), not by
|
|
@@ -15191,6 +15200,10 @@ var ListGroupedFindingsQuery = external_exports.object({
|
|
|
15191
15200
|
subtype: external_exports.array(external_exports.string()).optional(),
|
|
15192
15201
|
provider: external_exports.array(FindingProvider).optional(),
|
|
15193
15202
|
action: external_exports.array(FindingAction).optional(),
|
|
15203
|
+
// Matches a group's DERIVED status (see FindingGroup.status), not its
|
|
15204
|
+
// individual instances' — so a filtered group's Status column always reads
|
|
15205
|
+
// one of the requested values.
|
|
15206
|
+
status: external_exports.array(FindingStatus).optional(),
|
|
15194
15207
|
q: external_exports.string().optional(),
|
|
15195
15208
|
// Scope to findings whose event carries this session id (the Activity page's
|
|
15196
15209
|
// session → findings drilldown). Findings without a session never match.
|
|
@@ -15371,6 +15384,33 @@ var ToolCallAttributes = external_exports.object({
|
|
|
15371
15384
|
parent_uuid: external_exports.string().optional(),
|
|
15372
15385
|
run_key: external_exports.string().optional()
|
|
15373
15386
|
}).catchall(external_exports.unknown());
|
|
15387
|
+
var CaptureAttributes = external_exports.object({
|
|
15388
|
+
// The harness/tool that produced the capture (`claude-code`, `cli`, …). A
|
|
15389
|
+
// column on the legacy `events` table; here it rides the bag because a
|
|
15390
|
+
// capture-typed audit row has no equivalent column of its own.
|
|
15391
|
+
source_tool: external_exports.string().optional(),
|
|
15392
|
+
file_path: external_exports.string().optional(),
|
|
15393
|
+
repo: external_exports.string().optional(),
|
|
15394
|
+
// The host tool whose input/output was scanned (e.g. 'Bash', 'WebFetch') —
|
|
15395
|
+
// gives a non-file capture a display location ("via Bash") when file_path
|
|
15396
|
+
// is absent. The tool NAME only, never its arguments/output.
|
|
15397
|
+
tool_name: external_exports.string().optional(),
|
|
15398
|
+
// Presence-only provenance flag: set when the file is excluded by the
|
|
15399
|
+
// repo's .gitignore. Omitted (not false) for tracked files.
|
|
15400
|
+
gitignored: external_exports.boolean().optional(),
|
|
15401
|
+
// Set ONLY when the capture is a COMPLETE file snapshot (a worktree scan
|
|
15402
|
+
// reading from disk), never a partial fragment (a hook-captured edit).
|
|
15403
|
+
whole_file: external_exports.boolean().optional(),
|
|
15404
|
+
// Distributed-tracing correlation: `correlation_id` ties the capture back to
|
|
15405
|
+
// the request that produced it; `trace_id` is the originating span's W3C
|
|
15406
|
+
// trace id when telemetry is enabled.
|
|
15407
|
+
correlation_id: external_exports.uuid().optional(),
|
|
15408
|
+
trace_id: external_exports.string().regex(/^[0-9a-f]{32}$/).optional(),
|
|
15409
|
+
// Ids of the detection exceptions that downgraded findings in this capture
|
|
15410
|
+
// to 'allow' — the enforcement audit trail's link back to the grant that
|
|
15411
|
+
// authorized the bypass.
|
|
15412
|
+
exception_ids: external_exports.array(external_exports.guid()).optional()
|
|
15413
|
+
}).catchall(external_exports.unknown());
|
|
15374
15414
|
var ToolCallInspection = external_exports.object({
|
|
15375
15415
|
ruleId: external_exports.string().min(1),
|
|
15376
15416
|
ruleName: external_exports.string(),
|
|
@@ -15457,7 +15497,18 @@ var InspectionFindingInput = external_exports.object({
|
|
|
15457
15497
|
span: Span,
|
|
15458
15498
|
maskedMatch: external_exports.string(),
|
|
15459
15499
|
actionTaken: ActionTaken,
|
|
15460
|
-
confidence: external_exports.number().min(0).max(1)
|
|
15500
|
+
confidence: external_exports.number().min(0).max(1),
|
|
15501
|
+
// Stable, content-addressed key correlating this finding across re-detections
|
|
15502
|
+
// — mirrors the legacy `findings.finding_key` (uq_inspection_findings_key is
|
|
15503
|
+
// its unique index). Optional: only an at-rest/re-scannable finding carries
|
|
15504
|
+
// one; an in-flight capture (prompt/response) has nothing to re-detect
|
|
15505
|
+
// against and leaves it unset, so every insert is a fresh row.
|
|
15506
|
+
findingKey: external_exports.string().optional(),
|
|
15507
|
+
// The ORIGINAL detection time, preserved across a later re-detection of the
|
|
15508
|
+
// same findingKey — mirrors the legacy `findings.first_detected_at`.
|
|
15509
|
+
// Optional: when omitted, the writer derives it from the referenced audit
|
|
15510
|
+
// event's startedAt on first insert (see SqliteInspectionFindingsRepository).
|
|
15511
|
+
firstDetectedAt: external_exports.iso.datetime().optional()
|
|
15461
15512
|
});
|
|
15462
15513
|
var InventoryContext = external_exports.object({
|
|
15463
15514
|
host: InventoryInput.optional(),
|
|
@@ -15656,6 +15707,7 @@ var ActivityOverviewResponse = external_exports.object({
|
|
|
15656
15707
|
|
|
15657
15708
|
// ../../packages/schema/src/zod/event.ts
|
|
15658
15709
|
var EventKind = external_exports.enum(["prompt", "response", "code_change", "tool_use"]).meta({ id: "EventKind" });
|
|
15710
|
+
var CAPTURE_EVENT_TYPES_SQL = EventKind.options.map((k) => `'${k}'`).join(",");
|
|
15659
15711
|
var SourceTool = external_exports.enum(["claude-code", "claude-desktop", "cursor", "chatgpt", "github-copilot", "cli", "unknown"]).meta({ id: "SourceTool" });
|
|
15660
15712
|
var EventMetadata = external_exports.object({
|
|
15661
15713
|
sessionId: external_exports.string().optional(),
|
|
@@ -16145,6 +16197,12 @@ var PolicyBundle = external_exports.object({
|
|
|
16145
16197
|
// on-disk caches — that omit the field still parse; consumers read
|
|
16146
16198
|
// `bundle.exceptions ?? []`.
|
|
16147
16199
|
exceptions: external_exports.array(ExceptionBundleEntry).optional(),
|
|
16200
|
+
// Installed pack version, keyed by ruleId, for rules in `rules` that came
|
|
16201
|
+
// from a versioned installed pack. Optional so older backends — and older
|
|
16202
|
+
// on-disk caches — that omit the field still parse; consumers fall back to
|
|
16203
|
+
// the rule's own spec version. NOT the bundle version above — see
|
|
16204
|
+
// installedRuleset's ruleVersions for the source of truth.
|
|
16205
|
+
ruleVersions: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
16148
16206
|
customKeywords: external_exports.array(external_exports.string()),
|
|
16149
16207
|
fetchedAt: external_exports.iso.datetime()
|
|
16150
16208
|
}).meta({ id: "PolicyBundle" });
|
|
@@ -16743,10 +16801,14 @@ var PatchInstalledPackRequest = external_exports.object({
|
|
|
16743
16801
|
}).meta({ id: "PatchInstalledPackRequest" });
|
|
16744
16802
|
|
|
16745
16803
|
// ../../packages/schema/src/zod/local.ts
|
|
16746
|
-
var WORKSPACE_SETTINGS_SPEC_VERSION =
|
|
16804
|
+
var WORKSPACE_SETTINGS_SPEC_VERSION = 4;
|
|
16747
16805
|
var RunMode = external_exports.enum(["standalone"]);
|
|
16748
16806
|
var SimpleDetectionPolicy = external_exports.enum(["redact", "warn"]);
|
|
16749
16807
|
var HistoricalAccess = external_exports.enum(["full", "session-only"]);
|
|
16808
|
+
var ModelJudgeConsent = external_exports.object({
|
|
16809
|
+
acknowledgedAt: external_exports.iso.datetime(),
|
|
16810
|
+
payloadVersion: external_exports.number().int().positive()
|
|
16811
|
+
});
|
|
16750
16812
|
var WorkspaceSettings = external_exports.object({
|
|
16751
16813
|
specVersion: external_exports.number().int().positive().default(WORKSPACE_SETTINGS_SPEC_VERSION),
|
|
16752
16814
|
// Settings files written by earlier releases may carry the retired 'attached'
|
|
@@ -16762,7 +16824,12 @@ var WorkspaceSettings = external_exports.object({
|
|
|
16762
16824
|
// Shares writes.
|
|
16763
16825
|
dataSharesInPlace: external_exports.boolean().default(true),
|
|
16764
16826
|
// Absent until /aka:setup completes; its presence is what "onboarded" means.
|
|
16765
|
-
onboardedAt: external_exports.iso.datetime().optional()
|
|
16827
|
+
onboardedAt: external_exports.iso.datetime().optional(),
|
|
16828
|
+
// Records that the user consented to sending findings to the model API for
|
|
16829
|
+
// the /aka:setup judge, along with the payload-shape version they agreed to.
|
|
16830
|
+
// Absent until granted; a stale payloadVersion means the consent no longer
|
|
16831
|
+
// covers the current payload and must be re-granted.
|
|
16832
|
+
modelJudgeConsent: ModelJudgeConsent.optional()
|
|
16766
16833
|
});
|
|
16767
16834
|
function defaultWorkspaceSettings() {
|
|
16768
16835
|
return WorkspaceSettings.parse({});
|
|
@@ -17144,9 +17211,29 @@ var SetupHandoffOffer = external_exports.object({
|
|
|
17144
17211
|
import { createHash } from "crypto";
|
|
17145
17212
|
|
|
17146
17213
|
// ../../packages/persistence/src/paths.ts
|
|
17147
|
-
import { chmodSync, mkdirSync } from "fs";
|
|
17214
|
+
import { chmodSync, lstatSync, mkdirSync, renameSync, rmSync, writeFileSync } from "fs";
|
|
17148
17215
|
var DATA_DIR_MODE = 448;
|
|
17149
17216
|
var DATA_FILE_MODE = 384;
|
|
17217
|
+
function chmodBestEffort(path, mode) {
|
|
17218
|
+
try {
|
|
17219
|
+
chmodSync(path, mode);
|
|
17220
|
+
} catch {
|
|
17221
|
+
}
|
|
17222
|
+
}
|
|
17223
|
+
function tightenDir(dir) {
|
|
17224
|
+
chmodBestEffort(dir, DATA_DIR_MODE);
|
|
17225
|
+
}
|
|
17226
|
+
function ensureDataDirSync(dir) {
|
|
17227
|
+
mkdirSync(dir, { recursive: true, mode: DATA_DIR_MODE });
|
|
17228
|
+
tightenDir(dir);
|
|
17229
|
+
}
|
|
17230
|
+
function tightenFile(file2) {
|
|
17231
|
+
try {
|
|
17232
|
+
if (lstatSync(file2).isSymbolicLink()) return;
|
|
17233
|
+
} catch {
|
|
17234
|
+
}
|
|
17235
|
+
chmodBestEffort(file2, DATA_FILE_MODE);
|
|
17236
|
+
}
|
|
17150
17237
|
|
|
17151
17238
|
// ../../packages/persistence/src/internal/json.ts
|
|
17152
17239
|
function parseJsonObject(s) {
|
|
@@ -17187,14 +17274,18 @@ import { randomUUID as randomUUID6 } from "crypto";
|
|
|
17187
17274
|
// ../../packages/persistence/src/repositories/shares.ts
|
|
17188
17275
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
17189
17276
|
|
|
17277
|
+
// ../../packages/persistence/src/finding-key.ts
|
|
17278
|
+
import { createHash as createHash3 } from "crypto";
|
|
17279
|
+
|
|
17190
17280
|
// ../../packages/persistence/src/fingerprint.ts
|
|
17191
17281
|
import { createHmac, randomBytes } from "crypto";
|
|
17192
|
-
import {
|
|
17282
|
+
import { existsSync as existsSync2, readFileSync } from "fs";
|
|
17193
17283
|
import { join as join2 } from "path";
|
|
17284
|
+
import { DatabaseSync as DatabaseSync2 } from "node:sqlite";
|
|
17194
17285
|
|
|
17195
17286
|
// ../../packages/persistence/src/local-layout.ts
|
|
17196
|
-
import {
|
|
17197
|
-
import {
|
|
17287
|
+
import { renameSync as renameSync3 } from "fs";
|
|
17288
|
+
import { mkdir } from "fs/promises";
|
|
17198
17289
|
import { homedir } from "os";
|
|
17199
17290
|
import { join as join3 } from "path";
|
|
17200
17291
|
function defaultDataDir() {
|
|
@@ -17209,6 +17300,9 @@ function dataDir(base = defaultDataDir()) {
|
|
|
17209
17300
|
function dbPath(base = defaultDataDir()) {
|
|
17210
17301
|
return join3(dataDir(base), "aka.db");
|
|
17211
17302
|
}
|
|
17303
|
+
function ensureLayoutDirSync(dir = defaultDataDir()) {
|
|
17304
|
+
ensureDataDirSync(dir);
|
|
17305
|
+
}
|
|
17212
17306
|
function migrateLegacyLayout(base = defaultDataDir()) {
|
|
17213
17307
|
const moves = [
|
|
17214
17308
|
{ name: "config.json", dest: settingsDir(base) },
|
|
@@ -17216,19 +17310,17 @@ function migrateLegacyLayout(base = defaultDataDir()) {
|
|
|
17216
17310
|
];
|
|
17217
17311
|
for (const { name, dest } of moves) {
|
|
17218
17312
|
try {
|
|
17219
|
-
|
|
17220
|
-
|
|
17221
|
-
|
|
17222
|
-
|
|
17223
|
-
}
|
|
17224
|
-
renameSync3(join3(base, name), join3(dest, name));
|
|
17313
|
+
ensureDataDirSync(dest);
|
|
17314
|
+
const moved = join3(dest, name);
|
|
17315
|
+
renameSync3(join3(base, name), moved);
|
|
17316
|
+
tightenFile(moved);
|
|
17225
17317
|
} catch {
|
|
17226
17318
|
}
|
|
17227
17319
|
}
|
|
17228
17320
|
}
|
|
17229
17321
|
|
|
17230
17322
|
// ../../packages/persistence/src/settings.ts
|
|
17231
|
-
import { readFileSync as readFileSync2
|
|
17323
|
+
import { readFileSync as readFileSync2 } from "fs";
|
|
17232
17324
|
import { join as join4 } from "path";
|
|
17233
17325
|
function readWorkspaceSettings(base = defaultDataDir()) {
|
|
17234
17326
|
const record2 = readJson(join4(settingsDir(base), "settings.json"));
|
|
@@ -17250,7 +17342,7 @@ function readJson(file2) {
|
|
|
17250
17342
|
}
|
|
17251
17343
|
|
|
17252
17344
|
// ../../packages/persistence/src/warn-era-cap.ts
|
|
17253
|
-
import { existsSync as
|
|
17345
|
+
import { existsSync as existsSync3, writeFileSync as writeFileSync2 } from "fs";
|
|
17254
17346
|
import { join as join5 } from "path";
|
|
17255
17347
|
|
|
17256
17348
|
// ../../packages/plugin-sdk/src/provider-env.ts
|
|
@@ -17303,6 +17395,12 @@ function resolveProvider() {
|
|
|
17303
17395
|
|
|
17304
17396
|
// ../../packages/plugin-sdk/src/config.ts
|
|
17305
17397
|
function loadConfig(base = defaultDataDir()) {
|
|
17398
|
+
try {
|
|
17399
|
+
ensureLayoutDirSync(base);
|
|
17400
|
+
const settingsFile = join6(settingsDir(base), "settings.json");
|
|
17401
|
+
if (existsSync4(settingsFile)) tightenFile(settingsFile);
|
|
17402
|
+
} catch {
|
|
17403
|
+
}
|
|
17306
17404
|
migrateLegacyLayout(base);
|
|
17307
17405
|
const settings = readWorkspaceSettings(base);
|
|
17308
17406
|
return {
|
|
@@ -17325,7 +17423,7 @@ function resolveProviderSafe() {
|
|
|
17325
17423
|
// ../../packages/plugin-sdk/src/config-inventory.ts
|
|
17326
17424
|
import { readdirSync, readFileSync as readFileSync4, realpathSync, statSync as statSync2 } from "fs";
|
|
17327
17425
|
import { homedir as homedir2 } from "os";
|
|
17328
|
-
import { basename as basename2, join as
|
|
17426
|
+
import { basename as basename2, join as join8 } from "path";
|
|
17329
17427
|
|
|
17330
17428
|
// ../../packages/detections/src/egress/registry.ts
|
|
17331
17429
|
var EXTRACTOR_VERSION = "1";
|
|
@@ -18036,21 +18134,18 @@ var POLYNOMIAL_PROBES = ["abc-", "a.", "a ", "a=", "x", "0", "a@", "a/", "ab"].m
|
|
|
18036
18134
|
);
|
|
18037
18135
|
|
|
18038
18136
|
// ../../packages/plugin-sdk/src/repo.ts
|
|
18039
|
-
import { existsSync as
|
|
18040
|
-
import { basename, dirname, isAbsolute, join as
|
|
18137
|
+
import { existsSync as existsSync5, readFileSync as readFileSync3, statSync } from "fs";
|
|
18138
|
+
import { basename, dirname, isAbsolute, join as join7, sep as sep2 } from "path";
|
|
18041
18139
|
|
|
18042
18140
|
// ../../packages/plugin-sdk/src/events.ts
|
|
18043
|
-
import { createHash as
|
|
18044
|
-
|
|
18045
|
-
// ../../packages/plugin-sdk/src/finding-key.ts
|
|
18046
|
-
import { createHash as createHash4 } from "crypto";
|
|
18141
|
+
import { createHash as createHash4, randomUUID as randomUUID9 } from "crypto";
|
|
18047
18142
|
|
|
18048
18143
|
// ../../packages/plugin-sdk/src/inventory-resolver.ts
|
|
18049
18144
|
import { arch, hostname as hostname3, platform, release } from "os";
|
|
18050
18145
|
|
|
18051
18146
|
// ../../packages/plugin-sdk/src/nudge.ts
|
|
18052
|
-
import { mkdirSync as
|
|
18053
|
-
import { join as
|
|
18147
|
+
import { mkdirSync as mkdirSync2, readFileSync as readFileSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
18148
|
+
import { join as join9 } from "path";
|
|
18054
18149
|
|
|
18055
18150
|
// ../../packages/plugin-sdk/src/paths.ts
|
|
18056
18151
|
import { readdirSync as readdirSync2, realpathSync as realpathSync2 } from "fs";
|
|
@@ -18058,8 +18153,8 @@ import { basename as basename3, dirname as dirname2, sep as sep3 } from "path";
|
|
|
18058
18153
|
|
|
18059
18154
|
// ../../packages/plugin-sdk/src/project-files.ts
|
|
18060
18155
|
var import_ignore = __toESM(require_ignore(), 1);
|
|
18061
|
-
import { existsSync as
|
|
18062
|
-
import { basename as basename4, join as
|
|
18156
|
+
import { existsSync as existsSync6, readdirSync as readdirSync3, readFileSync as readFileSync6 } from "fs";
|
|
18157
|
+
import { basename as basename4, join as join10, relative, sep as sep4 } from "path";
|
|
18063
18158
|
|
|
18064
18159
|
// ../../packages/plugin-sdk/src/runtime.ts
|
|
18065
18160
|
import { randomUUID as randomUUID10 } from "crypto";
|
|
@@ -18068,17 +18163,17 @@ import { randomUUID as randomUUID10 } from "crypto";
|
|
|
18068
18163
|
var THIRTY_DAYS_MS = 30 * 24 * 60 * 60 * 1e3;
|
|
18069
18164
|
|
|
18070
18165
|
// ../../packages/plugin-sdk/src/throttle.ts
|
|
18071
|
-
import { mkdirSync as
|
|
18072
|
-
import { join as
|
|
18166
|
+
import { mkdirSync as mkdirSync3, statSync as statSync3, writeFileSync as writeFileSync4 } from "fs";
|
|
18167
|
+
import { join as join11 } from "path";
|
|
18073
18168
|
function throttled(dataDir2, markerName, windowMs) {
|
|
18074
|
-
const marker =
|
|
18169
|
+
const marker = join11(dataDir2, markerName);
|
|
18075
18170
|
try {
|
|
18076
18171
|
if (Date.now() - statSync3(marker).mtimeMs < windowMs) return true;
|
|
18077
18172
|
} catch {
|
|
18078
18173
|
}
|
|
18079
18174
|
try {
|
|
18080
|
-
|
|
18081
|
-
|
|
18175
|
+
mkdirSync3(dataDir2, { recursive: true, mode: DATA_DIR_MODE });
|
|
18176
|
+
writeFileSync4(marker, String(Date.now()), { mode: DATA_FILE_MODE });
|
|
18082
18177
|
} catch {
|
|
18083
18178
|
}
|
|
18084
18179
|
return false;
|
|
@@ -18086,7 +18181,7 @@ function throttled(dataDir2, markerName, windowMs) {
|
|
|
18086
18181
|
|
|
18087
18182
|
// src/history/reconcile-trigger.ts
|
|
18088
18183
|
import { spawn } from "child_process";
|
|
18089
|
-
import { dirname as dirname3, join as
|
|
18184
|
+
import { dirname as dirname3, join as join13 } from "path";
|
|
18090
18185
|
import { fileURLToPath } from "url";
|
|
18091
18186
|
|
|
18092
18187
|
// src/history/tail.ts
|
|
@@ -18094,13 +18189,13 @@ import { createHash as createHash5 } from "crypto";
|
|
|
18094
18189
|
import {
|
|
18095
18190
|
closeSync,
|
|
18096
18191
|
fstatSync,
|
|
18097
|
-
mkdirSync as
|
|
18192
|
+
mkdirSync as mkdirSync4,
|
|
18098
18193
|
openSync,
|
|
18099
18194
|
readFileSync as readFileSync7,
|
|
18100
18195
|
readSync,
|
|
18101
|
-
writeFileSync as
|
|
18196
|
+
writeFileSync as writeFileSync5
|
|
18102
18197
|
} from "fs";
|
|
18103
|
-
import { join as
|
|
18198
|
+
import { join as join12 } from "path";
|
|
18104
18199
|
var SAFE_SESSION_ID = /^[A-Za-z0-9._-]+$/;
|
|
18105
18200
|
function safeSessionId(sessionId) {
|
|
18106
18201
|
if (SAFE_SESSION_ID.test(sessionId) && sessionId !== "." && sessionId !== "..") {
|
|
@@ -18117,7 +18212,7 @@ function triggerReconcile(dataDir2, sessionId, transcriptPath) {
|
|
|
18117
18212
|
const marker = `${RECONCILE_MARKER_PREFIX}-${safeSessionId(sessionId)}`;
|
|
18118
18213
|
if (throttled(dataDir2, marker, RECONCILE_THROTTLE_MS)) return;
|
|
18119
18214
|
const here = dirname3(fileURLToPath(import.meta.url));
|
|
18120
|
-
const child = spawn(process.execPath, [
|
|
18215
|
+
const child = spawn(process.execPath, [join13(here, "reconcile.js"), sessionId, transcriptPath], {
|
|
18121
18216
|
detached: true,
|
|
18122
18217
|
stdio: "ignore"
|
|
18123
18218
|
});
|
package/scripts/triage-rubric.md
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
You are the AKA Security setup wizard's inline triage step. You have just
|
|
4
4
|
scanned a workspace (working tree and/or history) and detected a set of raw
|
|
5
5
|
hits — matches from AKA's deterministic regex detection rules, shown to you
|
|
6
|
-
with their real (unmasked) value and surrounding context
|
|
7
|
-
|
|
6
|
+
with their real (unmasked) value (`rawMatch`) and a surrounding context window
|
|
7
|
+
that has itself been masked for any other secrets, so you can judge each hit by
|
|
8
|
+
its own value. This is a one-time, transient look: the raw values are **never
|
|
8
9
|
persisted** — only your verdicts are written, as neutral exceptions and
|
|
9
10
|
per-category policies.
|
|
10
11
|
|
|
@@ -12,7 +13,7 @@ You will receive the hits below as a JSONL block, one `TriageHit` object per
|
|
|
12
13
|
line:
|
|
13
14
|
|
|
14
15
|
```
|
|
15
|
-
{"
|
|
16
|
+
{"id":"...","ruleId":"...","category":"...","severity":"...","maskedMatch":"...","rawMatch":"...","context":"...","confidence":0.9}
|
|
16
17
|
```
|
|
17
18
|
|
|
18
19
|
## Step 1 — Silently filter false positives
|