refactor: hard-fork GSD -> MSD (Make Software Done)
Mechanical rename produced by scripts/msd-rename.cjs: gsd/Gsd/GSD -> msd/Msd/MSD across contents and paths, upstream package/repo coordinates -> @golem15/msd-core and golem15com/msd-core. Deep links into upstream history, sibling upstream packages, the GSD-2 import feature, CHANGELOG.md and .changeset/ are kept as-is. Hand edits on top: MSD block-letter banner and logos, LICENSE copyright line, package/plugin identity, regenerated lockfile, install-tree fixtures, derived registries and benchmark baseline; migration checksum baseline re-locked (MSD keeps its own install state, so no install had applied the old sums); sort-order and regex-escaped expectations in tests adjusted.
This commit is contained in:
@@ -12,7 +12,7 @@ const assert = require('node:assert/strict');
|
||||
|
||||
const {
|
||||
makeDispatchEvent,
|
||||
} = require('../../gsd-core/bin/lib/observability/event.cjs');
|
||||
} = require('../../msd-core/bin/lib/observability/event.cjs');
|
||||
|
||||
describe('makeDispatchEvent — shape', () => {
|
||||
test('returns an object with required top-level fields', () => {
|
||||
|
||||
@@ -22,11 +22,11 @@ const os = require('os');
|
||||
|
||||
const {
|
||||
createHub,
|
||||
} = require('../../gsd-core/bin/lib/command-routing-hub.cjs');
|
||||
} = require('../../msd-core/bin/lib/command-routing-hub.cjs');
|
||||
|
||||
const {
|
||||
createDefaultLogger,
|
||||
} = require('../../gsd-core/bin/lib/observability/logger.cjs');
|
||||
} = require('../../msd-core/bin/lib/observability/logger.cjs');
|
||||
const { cleanup } = require('../helpers.cjs');
|
||||
|
||||
// ─── helpers ─────────────────────────────────────────────────────────────────
|
||||
@@ -43,7 +43,7 @@ function makeTrackingLogger() {
|
||||
}
|
||||
|
||||
function makeTmpDir() {
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-hub-logger-test-'));
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'msd-hub-logger-test-'));
|
||||
}
|
||||
|
||||
/** Capture all stderr writes during fn() */
|
||||
@@ -336,15 +336,15 @@ describe('Hub + createDefaultLogger — end-to-end', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = makeTmpDir();
|
||||
savedAudit = process.env.GSD_AUDIT;
|
||||
savedAuditArgs = process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.GSD_AUDIT;
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
savedAudit = process.env.MSD_AUDIT;
|
||||
savedAuditArgs = process.env.MSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedAudit === undefined) delete process.env.GSD_AUDIT; else process.env.GSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.GSD_AUDIT_ARGS; else process.env.GSD_AUDIT_ARGS = savedAuditArgs;
|
||||
if (savedAudit === undefined) delete process.env.MSD_AUDIT; else process.env.MSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.MSD_AUDIT_ARGS; else process.env.MSD_AUDIT_ARGS = savedAuditArgs;
|
||||
cleanup(tmpDir);
|
||||
});
|
||||
|
||||
@@ -364,14 +364,14 @@ describe('Hub + createDefaultLogger — end-to-end', () => {
|
||||
assert.equal(parsed.kind, 'HandlerRefusal');
|
||||
});
|
||||
|
||||
test('audit file written when GSD_AUDIT=1', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
test('audit file written when MSD_AUDIT=1', () => {
|
||||
process.env.MSD_AUDIT = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
const hub = makeHub(logger);
|
||||
hub.dispatch({ family: 'plan', subcommand: '' });
|
||||
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
assert.ok(fs.existsSync(auditPath), 'audit file must exist after dispatch with GSD_AUDIT=1');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
assert.ok(fs.existsSync(auditPath), 'audit file must exist after dispatch with MSD_AUDIT=1');
|
||||
|
||||
const line = fs.readFileSync(auditPath, 'utf8').trim();
|
||||
const parsed = JSON.parse(line);
|
||||
|
||||
@@ -17,13 +17,13 @@ const os = require('os');
|
||||
const {
|
||||
createDefaultLogger,
|
||||
createNoOpLogger,
|
||||
} = require('../../gsd-core/bin/lib/observability/logger.cjs');
|
||||
} = require('../../msd-core/bin/lib/observability/logger.cjs');
|
||||
const { cleanup } = require('../helpers.cjs');
|
||||
|
||||
// ─── helpers ─────────────────────────────────────────────────────────────────
|
||||
|
||||
function makeTmpDir() {
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'gsd-logger-test-'));
|
||||
return fs.mkdtempSync(path.join(os.tmpdir(), 'msd-logger-test-'));
|
||||
}
|
||||
|
||||
function captureStderr(fn) {
|
||||
@@ -97,15 +97,15 @@ describe('createDefaultLogger — silent on success', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = makeTmpDir();
|
||||
savedAudit = process.env.GSD_AUDIT;
|
||||
savedAuditArgs = process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.GSD_AUDIT;
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
savedAudit = process.env.MSD_AUDIT;
|
||||
savedAuditArgs = process.env.MSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedAudit === undefined) delete process.env.GSD_AUDIT; else process.env.GSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.GSD_AUDIT_ARGS; else process.env.GSD_AUDIT_ARGS = savedAuditArgs;
|
||||
if (savedAudit === undefined) delete process.env.MSD_AUDIT; else process.env.MSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.MSD_AUDIT_ARGS; else process.env.MSD_AUDIT_ARGS = savedAuditArgs;
|
||||
cleanup(tmpDir);
|
||||
});
|
||||
|
||||
@@ -115,11 +115,11 @@ describe('createDefaultLogger — silent on success', () => {
|
||||
assert.equal(stderrOutput, '', 'must not write to stderr on ok result');
|
||||
});
|
||||
|
||||
test('no audit file created on ok result (no GSD_AUDIT)', () => {
|
||||
test('no audit file created on ok result (no MSD_AUDIT)', () => {
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
logger.onEvent(makeOkEvent());
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
assert.ok(!fs.existsSync(auditPath), 'audit file must not be created without GSD_AUDIT=1');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
assert.ok(!fs.existsSync(auditPath), 'audit file must not be created without MSD_AUDIT=1');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -132,15 +132,15 @@ describe('createDefaultLogger — stderr on error', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = makeTmpDir();
|
||||
savedAudit = process.env.GSD_AUDIT;
|
||||
savedAuditArgs = process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.GSD_AUDIT;
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
savedAudit = process.env.MSD_AUDIT;
|
||||
savedAuditArgs = process.env.MSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedAudit === undefined) delete process.env.GSD_AUDIT; else process.env.GSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.GSD_AUDIT_ARGS; else process.env.GSD_AUDIT_ARGS = savedAuditArgs;
|
||||
if (savedAudit === undefined) delete process.env.MSD_AUDIT; else process.env.MSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.MSD_AUDIT_ARGS; else process.env.MSD_AUDIT_ARGS = savedAuditArgs;
|
||||
cleanup(tmpDir);
|
||||
});
|
||||
|
||||
@@ -192,8 +192,8 @@ describe('createDefaultLogger — stderr on error', () => {
|
||||
assert.ok(!('args' in parsed), 'args must be redacted from stderr output by default');
|
||||
});
|
||||
|
||||
test('stderr JSON includes args when GSD_AUDIT_ARGS=1', () => {
|
||||
process.env.GSD_AUDIT_ARGS = '1';
|
||||
test('stderr JSON includes args when MSD_AUDIT_ARGS=1', () => {
|
||||
process.env.MSD_AUDIT_ARGS = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
const errEvent = Object.assign(
|
||||
makeErrEvent({ kind: 'InvalidArgs', arg: '--bad', reason: 'oops' }),
|
||||
@@ -201,12 +201,12 @@ describe('createDefaultLogger — stderr on error', () => {
|
||||
);
|
||||
const stderrOutput = captureStderr(() => logger.onEvent(errEvent));
|
||||
const parsed = JSON.parse(stderrOutput.trim());
|
||||
assert.ok('args' in parsed, 'args must appear in stderr when GSD_AUDIT_ARGS=1');
|
||||
assert.ok('args' in parsed, 'args must appear in stderr when MSD_AUDIT_ARGS=1');
|
||||
assert.deepStrictEqual(parsed.args, ['--bad', 'value']);
|
||||
});
|
||||
|
||||
test('no stderr output on ok result even when GSD_AUDIT=1', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
test('no stderr output on ok result even when MSD_AUDIT=1', () => {
|
||||
process.env.MSD_AUDIT = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
const stderrOutput = captureStderr(() => logger.onEvent(makeOkEvent()));
|
||||
assert.equal(stderrOutput, '', 'ok result must never produce stderr output');
|
||||
@@ -222,28 +222,28 @@ describe('createDefaultLogger — audit file', () => {
|
||||
|
||||
beforeEach(() => {
|
||||
tmpDir = makeTmpDir();
|
||||
savedAudit = process.env.GSD_AUDIT;
|
||||
savedAuditArgs = process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.GSD_AUDIT;
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
savedAudit = process.env.MSD_AUDIT;
|
||||
savedAuditArgs = process.env.MSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (savedAudit === undefined) delete process.env.GSD_AUDIT; else process.env.GSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.GSD_AUDIT_ARGS; else process.env.GSD_AUDIT_ARGS = savedAuditArgs;
|
||||
if (savedAudit === undefined) delete process.env.MSD_AUDIT; else process.env.MSD_AUDIT = savedAudit;
|
||||
if (savedAuditArgs === undefined) delete process.env.MSD_AUDIT_ARGS; else process.env.MSD_AUDIT_ARGS = savedAuditArgs;
|
||||
cleanup(tmpDir);
|
||||
});
|
||||
|
||||
test('creates .planning/.gsd-trace.jsonl when GSD_AUDIT=1 (ok result)', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
test('creates .planning/.msd-trace.jsonl when MSD_AUDIT=1 (ok result)', () => {
|
||||
process.env.MSD_AUDIT = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
logger.onEvent(makeOkEvent());
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
assert.ok(fs.existsSync(auditPath), 'audit file must be created when GSD_AUDIT=1');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
assert.ok(fs.existsSync(auditPath), 'audit file must be created when MSD_AUDIT=1');
|
||||
});
|
||||
|
||||
test('creates .planning/ directory if absent', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
process.env.MSD_AUDIT = '1';
|
||||
// tmpDir has no .planning/ subdirectory
|
||||
assert.ok(!fs.existsSync(path.join(tmpDir, '.planning')));
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
@@ -252,12 +252,12 @@ describe('createDefaultLogger — audit file', () => {
|
||||
});
|
||||
|
||||
test('audit file contains one valid JSON line per event', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
process.env.MSD_AUDIT = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
logger.onEvent(makeOkEvent({ traceId: 'a1' }));
|
||||
logger.onEvent(makeOkEvent({ traceId: 'a2' }));
|
||||
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
const content = fs.readFileSync(auditPath, 'utf8');
|
||||
const lines = content.split(/\r?\n/).filter(l => l.trim().length > 0);
|
||||
assert.equal(lines.length, 2, `expected 2 lines, got ${lines.length}`);
|
||||
@@ -269,8 +269,8 @@ describe('createDefaultLogger — audit file', () => {
|
||||
});
|
||||
|
||||
test('audit file is append-only (second run adds to existing content)', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
process.env.MSD_AUDIT = '1';
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
|
||||
const logger1 = createDefaultLogger({ cwd: tmpDir });
|
||||
logger1.onEvent(makeOkEvent({ traceId: 'first' }));
|
||||
@@ -286,12 +286,12 @@ describe('createDefaultLogger — audit file', () => {
|
||||
});
|
||||
|
||||
test('audit file contains both ok and error events', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
process.env.MSD_AUDIT = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
logger.onEvent(makeOkEvent({ traceId: 'ok-event' }));
|
||||
logger.onEvent(makeErrEvent({ kind: 'HandlerFailure', message: 'boom' }, { traceId: 'err-event' }));
|
||||
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
const content = fs.readFileSync(auditPath, 'utf8');
|
||||
const lines = content.split(/\r?\n/).filter(l => l.trim().length > 0);
|
||||
assert.equal(lines.length, 2);
|
||||
@@ -302,37 +302,37 @@ describe('createDefaultLogger — audit file', () => {
|
||||
});
|
||||
|
||||
test('audit file does NOT contain args by default', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
process.env.MSD_AUDIT = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
const event = Object.assign(makeOkEvent(), { args: ['secret-arg'] });
|
||||
logger.onEvent(event);
|
||||
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
const content = fs.readFileSync(auditPath, 'utf8');
|
||||
const parsed = JSON.parse(content.trim());
|
||||
assert.ok(!('args' in parsed), 'args must be redacted from audit file by default');
|
||||
});
|
||||
|
||||
test('audit file DOES contain args when GSD_AUDIT_ARGS=1', () => {
|
||||
process.env.GSD_AUDIT = '1';
|
||||
process.env.GSD_AUDIT_ARGS = '1';
|
||||
test('audit file DOES contain args when MSD_AUDIT_ARGS=1', () => {
|
||||
process.env.MSD_AUDIT = '1';
|
||||
process.env.MSD_AUDIT_ARGS = '1';
|
||||
const logger = createDefaultLogger({ cwd: tmpDir });
|
||||
const event = Object.assign(makeOkEvent(), { args: ['visible-arg'] });
|
||||
logger.onEvent(event);
|
||||
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
const content = fs.readFileSync(auditPath, 'utf8');
|
||||
const parsed = JSON.parse(content.trim());
|
||||
assert.ok('args' in parsed, 'args must appear in audit file when GSD_AUDIT_ARGS=1');
|
||||
assert.ok('args' in parsed, 'args must appear in audit file when MSD_AUDIT_ARGS=1');
|
||||
assert.deepStrictEqual(parsed.args, ['visible-arg']);
|
||||
});
|
||||
|
||||
test('config.audit.enabled === true triggers audit file (without GSD_AUDIT env)', () => {
|
||||
// GSD_AUDIT is not set, but config says enabled
|
||||
test('config.audit.enabled === true triggers audit file (without MSD_AUDIT env)', () => {
|
||||
// MSD_AUDIT is not set, but config says enabled
|
||||
const logger = createDefaultLogger({ cwd: tmpDir, config: { audit: { enabled: true } } });
|
||||
logger.onEvent(makeOkEvent({ traceId: 'config-triggered' }));
|
||||
|
||||
const auditPath = path.join(tmpDir, '.planning', '.gsd-trace.jsonl');
|
||||
const auditPath = path.join(tmpDir, '.planning', '.msd-trace.jsonl');
|
||||
assert.ok(fs.existsSync(auditPath), 'audit file must be created when config.audit.enabled=true');
|
||||
const parsed = JSON.parse(fs.readFileSync(auditPath, 'utf8').trim());
|
||||
assert.equal(parsed.traceId, 'config-triggered');
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Tests for arg redaction policy (issue #177).
|
||||
*
|
||||
* Redaction decides whether args appear in emitted events based on
|
||||
* the GSD_AUDIT_ARGS env var. Tests use real env manipulation and
|
||||
* the MSD_AUDIT_ARGS env var. Tests use real env manipulation and
|
||||
* restore state in afterEach. No mocks.
|
||||
*/
|
||||
|
||||
@@ -14,48 +14,48 @@ const assert = require('node:assert/strict');
|
||||
const {
|
||||
shouldIncludeArgs,
|
||||
redactEvent,
|
||||
} = require('../../gsd-core/bin/lib/observability/redaction.cjs');
|
||||
} = require('../../msd-core/bin/lib/observability/redaction.cjs');
|
||||
|
||||
describe('shouldIncludeArgs', () => {
|
||||
let originalEnv;
|
||||
|
||||
beforeEach(() => {
|
||||
originalEnv = process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
originalEnv = process.env.MSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (originalEnv === undefined) {
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
} else {
|
||||
process.env.GSD_AUDIT_ARGS = originalEnv;
|
||||
process.env.MSD_AUDIT_ARGS = originalEnv;
|
||||
}
|
||||
});
|
||||
|
||||
test('returns false when GSD_AUDIT_ARGS is not set', () => {
|
||||
test('returns false when MSD_AUDIT_ARGS is not set', () => {
|
||||
assert.strictEqual(shouldIncludeArgs(), false);
|
||||
});
|
||||
|
||||
test('returns false when GSD_AUDIT_ARGS is empty string', () => {
|
||||
process.env.GSD_AUDIT_ARGS = '';
|
||||
test('returns false when MSD_AUDIT_ARGS is empty string', () => {
|
||||
process.env.MSD_AUDIT_ARGS = '';
|
||||
assert.strictEqual(shouldIncludeArgs(), false);
|
||||
});
|
||||
|
||||
test('returns false when GSD_AUDIT_ARGS is "0"', () => {
|
||||
process.env.GSD_AUDIT_ARGS = '0';
|
||||
test('returns false when MSD_AUDIT_ARGS is "0"', () => {
|
||||
process.env.MSD_AUDIT_ARGS = '0';
|
||||
assert.strictEqual(shouldIncludeArgs(), false);
|
||||
});
|
||||
|
||||
test('returns true when GSD_AUDIT_ARGS is "1"', () => {
|
||||
process.env.GSD_AUDIT_ARGS = '1';
|
||||
test('returns true when MSD_AUDIT_ARGS is "1"', () => {
|
||||
process.env.MSD_AUDIT_ARGS = '1';
|
||||
assert.strictEqual(shouldIncludeArgs(), true);
|
||||
});
|
||||
|
||||
test('returns false for any other non-1 value', () => {
|
||||
process.env.GSD_AUDIT_ARGS = 'yes';
|
||||
process.env.MSD_AUDIT_ARGS = 'yes';
|
||||
assert.strictEqual(shouldIncludeArgs(), false);
|
||||
|
||||
process.env.GSD_AUDIT_ARGS = 'true';
|
||||
process.env.MSD_AUDIT_ARGS = 'true';
|
||||
assert.strictEqual(shouldIncludeArgs(), false);
|
||||
});
|
||||
});
|
||||
@@ -64,19 +64,19 @@ describe('redactEvent', () => {
|
||||
let originalEnv;
|
||||
|
||||
beforeEach(() => {
|
||||
originalEnv = process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
originalEnv = process.env.MSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
if (originalEnv === undefined) {
|
||||
delete process.env.GSD_AUDIT_ARGS;
|
||||
delete process.env.MSD_AUDIT_ARGS;
|
||||
} else {
|
||||
process.env.GSD_AUDIT_ARGS = originalEnv;
|
||||
process.env.MSD_AUDIT_ARGS = originalEnv;
|
||||
}
|
||||
});
|
||||
|
||||
test('strips args from event when GSD_AUDIT_ARGS is not set', () => {
|
||||
test('strips args from event when MSD_AUDIT_ARGS is not set', () => {
|
||||
const event = Object.freeze({
|
||||
traceId: 'abc',
|
||||
command: 'plan',
|
||||
@@ -106,8 +106,8 @@ describe('redactEvent', () => {
|
||||
assert.deepStrictEqual(redacted.result, { kind: 'HandlerRefusal', reason: 'nope' });
|
||||
});
|
||||
|
||||
test('includes args when GSD_AUDIT_ARGS=1', () => {
|
||||
process.env.GSD_AUDIT_ARGS = '1';
|
||||
test('includes args when MSD_AUDIT_ARGS=1', () => {
|
||||
process.env.MSD_AUDIT_ARGS = '1';
|
||||
const event = Object.freeze({
|
||||
traceId: 'abc',
|
||||
command: 'plan',
|
||||
@@ -116,7 +116,7 @@ describe('redactEvent', () => {
|
||||
timestamp: new Date().toISOString(),
|
||||
});
|
||||
const redacted = redactEvent(event);
|
||||
assert.ok('args' in redacted, 'args must be present when GSD_AUDIT_ARGS=1');
|
||||
assert.ok('args' in redacted, 'args must be present when MSD_AUDIT_ARGS=1');
|
||||
assert.deepStrictEqual(redacted.args, ['--foo', 'bar']);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user