diff --git a/architecture/memory-service.js b/architecture/memory-service.js index e052b7f..577e4f7 100644 --- a/architecture/memory-service.js +++ b/architecture/memory-service.js @@ -55,7 +55,6 @@ class MemoryService { const payload = { type: 'correction', - id: correction.id, pattern: correction.pattern, exclude_pattern: correction.excludePattern || null, severity: correction.severity, @@ -65,9 +64,7 @@ class MemoryService { auto_detected: correction.autoDetected || true, manual_entry: correction.manualEntry || false, hit_count: 0, - context: correction.context || 'unknown', - created_at: new Date().toISOString(), - updated_at: new Date().toISOString() + context: correction.context || 'unknown' }; const response = await client.post('/records', payload); @@ -139,16 +136,13 @@ class MemoryService { const payload = { type: 'preference', - id: pref.id, category: pref.category, key: pref.key, value: pref.value, importance: pref.importance || 5, confidence: pref.confidence || 1.0, tags: JSON.stringify(pref.tags || []), - confirmed_count: pref.confirmedCount || 0, - created_at: new Date().toISOString(), - updated_at: new Date().toISOString() + confirmed_count: pref.confirmedCount || 0 }; const response = await client.post('/records', payload); @@ -183,14 +177,12 @@ class MemoryService { const payload = { type: 'episode', - id: episode.id, date: episode.date || new Date().toISOString().split('T')[0], summary: episode.summary, details: episode.details, project: episode.project, outcomes: JSON.stringify(episode.outcomes || []), - corrections_triggered: JSON.stringify(episode.correctionsTriggered || []), - created_at: new Date().toISOString() + corrections_triggered: JSON.stringify(episode.correctionsTriggered || []) }; const response = await client.post('/records', payload); @@ -226,14 +218,12 @@ class MemoryService { const payload = { type: 'decision', - id: decision.id, date: decision.date || new Date().toISOString().split('T')[0], project: decision.project, decision: decision.decision, alternatives: JSON.stringify(decision.alternatives || []), rationale: decision.rationale, - status: decision.status || 'active', - created_at: new Date().toISOString() + status: decision.status || 'active' }; const response = await client.post('/records', payload); @@ -271,9 +261,7 @@ class MemoryService { const payload = { type: 'validation', - id: run.id, session_id: run.sessionId, - timestamp: new Date().toISOString(), input_length: run.inputLength, output_length: run.outputLength, violations_found: run.violationsFound || 0, diff --git a/architecture/test-memory-connection.js b/architecture/test-memory-connection.js index 05c6adc..324a377 100644 --- a/architecture/test-memory-connection.js +++ b/architecture/test-memory-connection.js @@ -33,7 +33,6 @@ async function test() { console.log('\n2. Testing correction storage...'); try { const correction = await memory.storeCorrection({ - id: `correction_${Date.now()}`, pattern: '\\d+\\s*(%|percent)', severity: 'auto-correct', message: 'Quantitative claim requires evidence', @@ -61,7 +60,6 @@ async function test() { console.log('\n4. Testing preference storage...'); try { const pref = await memory.storePreference({ - id: `pref_${Date.now()}`, category: 'communication', key: 'format', value: 'concise', @@ -87,7 +85,6 @@ async function test() { console.log('\n6. Testing validation logging...'); try { await memory.logValidation({ - id: `run_${Date.now()}`, sessionId: 'test-session', inputLength: 100, outputLength: 200, diff --git a/debug-coloptions.sh b/debug-coloptions.sh new file mode 100644 index 0000000..79b08bf --- /dev/null +++ b/debug-coloptions.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Getting colOptions..." + +curl -s "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc/colOptions" \ + -H "xc-token: $NOCODB_TOKEN" | jq '.' diff --git a/fix-severity-status.sh b/fix-severity-status.sh new file mode 100644 index 0000000..f4ad325 --- /dev/null +++ b/fix-severity-status.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Get tokens +VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Updating severity column..." + +# Update severity column (ID: cv1al80v3ejvij0) +curl -s -X PATCH "http://192.168.25.5:8080/api/v2/meta/columns/cv1al80v3ejvij0" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "dtxp": "error,warning,auto-correct", + "meta": { + "options": [ + {"title": "error", "color": "#FF0000"}, + {"title": "warning", "color": "#FFA500"}, + {"title": "auto-correct", "color": "#FFFF00"} + ] + } + }' + +echo "" +echo "Updating status column..." + +# Update status column (ID: cxbxnyh03nkvd0a) +curl -s -X PATCH "http://192.168.25.5:8080/api/v2/meta/columns/cxbxnyh03nkvd0a" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "dtxp": "active,reversed,deprecated", + "meta": { + "options": [ + {"title": "active", "color": "#00FF00"}, + {"title": "reversed", "color": "#FFA500"}, + {"title": "deprecated", "color": "#808080"} + ] + } + }' + +echo "" +echo "Done!" diff --git a/fix-status-col.sh b/fix-status-col.sh new file mode 100644 index 0000000..eaef8e1 --- /dev/null +++ b/fix-status-col.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Updating status column..." + +curl -s -X PATCH "http://192.168.25.5:8080/api/v2/meta/columns/cxbxnyh03nkvd0a" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{"dtxp":"active,reversed,deprecated","meta":{"options":[{"title":"active","color":"#00FF00"},{"title":"reversed","color":"#FFA500"},{"title":"deprecated","color":"#808080"}]}}' + +echo "" +echo "Done!" diff --git a/fix-status-only.sh b/fix-status-only.sh new file mode 100644 index 0000000..8e128f7 --- /dev/null +++ b/fix-status-only.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Get tokens +VAULT_TOKEN=*** -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=*** -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Updating status column (ID: cxbxnyh03nkvd0a)..." + +# Update status column with proper options +curl -s -X PATCH "http://192.168.25.5:8080/api/v2/meta/columns/cxbxnyh03nkvd0a" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "dtxp": "active,reversed,deprecated", + "meta": { + "options": [ + {"title": "active", "color": "#00FF00"}, + {"title": "reversed", "color": "#FFA500"}, + {"title": "deprecated", "color": "#808080"} + ] + } + }' | jq -c '{id: .id, title: .title, meta: .meta}' + +echo "" +echo "Done!" diff --git a/fix-type-col.sh b/fix-type-col.sh new file mode 100644 index 0000000..d669d67 --- /dev/null +++ b/fix-type-col.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Fixing type column options (ID: ctkqqemeblx80cc)..." + +# Update type column with proper dtxp format +curl -s -X PATCH "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "dtxp": "correction,preference,episode,decision,validation" + }' + +echo "" +echo "Done!" diff --git a/fix-type-options.sh b/fix-type-options.sh new file mode 100644 index 0000000..e83573d --- /dev/null +++ b/fix-type-options.sh @@ -0,0 +1,30 @@ +#!/bin/bash + +VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Getting current column config..." + +# Get current column +curl -s "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc" \ + -H "xc-token: $NOCODB_TOKEN" | jq '.colOptions' + +echo "" +echo "Updating colOptions for type column..." + +# Update colOptions via the options endpoint +curl -s -X POST "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc/colOptions/options" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "options": [ + {"title": "correction", "color": "#FF0000"}, + {"title": "preference", "color": "#00FF00"}, + {"title": "episode", "color": "#0000FF"}, + {"title": "decision", "color": "#FFFF00"}, + {"title": "validation", "color": "#FF00FF"} + ] + }' + +echo "" +echo "Done!" diff --git a/fix-type-v2.sh b/fix-type-v2.sh new file mode 100644 index 0000000..de38986 --- /dev/null +++ b/fix-type-v2.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Patching type column with dtxp..." + +# Patch the column with proper enum values in dtxp +curl -s -X PATCH "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "dtxp": "'"'"'correction'"'"','"'"'preference'"'"','"'"'episode'"'"','"'"'decision'"'"','"'"'validation'"'"'" + }' + +echo "" +echo "Done!" diff --git a/recreate-type-column.sh b/recreate-type-column.sh new file mode 100644 index 0000000..044e38a --- /dev/null +++ b/recreate-type-column.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +VAULT_TOKEN=$(curl -sk -X POST -d '{"role_id":"75d2dcfb-9c65-7f60-59b4-eee8c7f8dc0e","secret_id":"6202b465-2f25-547c-ec07-f47cfc4dda3e"}' https://beavault.beawit.net:8200/v1/auth/approle/login | jq -r '.auth.client_token') +NOCODB_TOKEN=$(curl -sk -H "X-Vault-Token: $VAULT_TOKEN" https://beavault.beawit.net:8200/v1/kv/data/api/infrastructure | jq -r '.data.data["nocodb-token"]') + +echo "Deleting type column..." + +# Delete the type column +curl -s -X DELETE "http://192.168.25.5:8080/api/v2/meta/columns/ctkqqemeblx80cc" \ + -H "xc-token: $NOCODB_TOKEN" + +echo "" +echo "Recreating type column with options..." + +# Create new SingleSelect column with options +curl -s -X POST "http://192.168.25.5:8080/api/v2/meta/tables/mx149yctebfwvys/columns" \ + -H "xc-token: $NOCODB_TOKEN" \ + -H "Content-Type: application/json" \ + -d '{ + "column_name": "type", + "title": "type", + "uidt": "SingleSelect", + "dtxp": "correction,preference,episode,decision,validation" + }' + +echo "" +echo "Done!"