diff --git a/src/services/governance/index.js b/src/services/governance/index.js index 22cc434..dd3290b 100644 --- a/src/services/governance/index.js +++ b/src/services/governance/index.js @@ -132,8 +132,14 @@ export async function createProposal({ agent, target, newContent, reason }) { return { id, diff }; } -export async function validateProposal(id) { - const { meta, newContent } = await getProposal(id); +export async function validateProposal(proposalOrId) { + let proposal; + if (typeof proposalOrId === 'string') { + proposal = await getProposal(proposalOrId); + } else { + proposal = proposalOrId; + } + const { meta, newContent } = proposal; // 1. Allowlist check (redundant but safe) const { isAllowed } = resolveAndValidateTarget(meta.target); @@ -165,7 +171,7 @@ export async function applyProposal(id) { throw new Error(`Proposal is ${meta.status}, cannot apply.`); } - const validation = await validateProposal(id); + const validation = await validateProposal(proposal); if (!validation.valid) { // Mark as rejected if validation fails? // Or just throw? The governance agent should decide. diff --git a/torch-config-test.json b/torch-config-test.json deleted file mode 100644 index 3205b36..0000000 --- a/torch-config-test.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "dashboard": { - "auth": "admin:password123", - "relays": [ - "wss://secure.relay.com" - ] - } -} \ No newline at end of file