feat: updade workspace

This commit is contained in:
thanhnv
2026-07-11 15:56:31 +09:00
parent 4fc72332f5
commit 193a449829
120 changed files with 868 additions and 350 deletions
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
import { existsSync, mkdtempSync, readFileSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { ForbiddenException } from '@nestjs/common';
import { BadRequestException, ForbiddenException } from '@nestjs/common';
import { SettingsService } from '../src/settings/settings.service.js';
const viewer = { actor: 'viewer-1', role: 'viewer', project: 'default', tenant: 'default' };
@@ -41,6 +41,17 @@ test('viewer cannot write settings', () => {
});
});
test('invalid setting value is rejected before it reaches the store', () => {
withTempStore((storeFile) => {
const svc = new SettingsService();
assert.throws(
() => svc.set({ key: 'loop.max_steps', value: 0, reason: 'invalid lower bound' }, admin),
BadRequestException,
);
assert.equal(existsSync(storeFile), false);
});
});
test('org-admin writes and rolls back through governed store with audit', () => {
withTempStore((storeFile) => {
const svc = new SettingsService();