Commit Graph

85 Commits

Author SHA1 Message Date
nogueiraguh
1135e9d6a9 refactor: decompose monolith — app.py 10,600→143 lines, 30+ modules
Fase 0 complete: extract all business logic, auth, database, and 176
endpoints from monolithic app.py into dedicated modules.

Structure:
- app.py: FastAPI hub (CORS, routers, startup/shutdown)
- models.py: 13 Pydantic request models
- utils.py: shared utilities (embed status, upload validation, process registries)
- config.py: constants, env vars, model catalogs
- auth/: crypto, jwt_auth, oidc, rate_limit
- database/: db(), init_db(), schema DDL
- services/: genai, compliance, chat, terraform, embeddings, cis_reports, mcp
- routes/: 13 APIRouter modules (auth, users, oci_config, oci_explorer,
  genai, mcp, adb, embeddings, reports, chat, terraform, settings, cis_engine)

Also: README updated with OCIR auth instructions for manual docker run.

86 tests passing.
2026-04-06 15:20:10 -03:00
nogueiraguh
2e74d316ae test: baseline test suite — 86 tests covering auth, CRUD, settings, chat, terraform, reports, terminal 2026-04-03 17:31:39 -03:00
nogueiraguh
856e3b6674 feat: password change 3-step modal with strength meter, default admin/admin123 2026-04-02 18:09:44 -03:00
nogueiraguh
1f92f4a9b9 feat: single container image (nginx + backend), fix fresh DB init
- deploy/Dockerfile: unified image with supervisord (nginx + uvicorn)
- distribution/docker-compose.single.yml: single container option
- distribution/README.md: 3 deployment options (single, compose, docker run)
- Fix: add status column to chat_messages CREATE TABLE (was only in migration, broke fresh DB)
- push-images.sh: builds 3 images (unified, backend, frontend)
2026-04-02 15:07:45 -03:00
nogueiraguh
f22bb54e25 feat: Oracle IAM OIDC, force password change, security hardening
- OIDC: authorization code flow, JWKS validation, JIT provisioning, group-to-role mapping, dual auth (local/oidc/both)
- Force password change: random admin password on first install, modal blocks UI until changed
- APP_SECRET required in docker-compose (fail if missing), .env.example improved
- Login page: Oracle IAM button (conditional), hide form in oidc-only mode
- OracleIamPage: test connection via backend, masked client_secret handling
- UsersPage: OIDC badge, auth_provider in list
- i18n: login.oidcButton, login.or (pt/en/es)
- README v3.1: Terminal, User Management, Security, OIDC endpoints, versioning
2026-04-02 10:26:00 -03:00
nogueiraguh
60596e790f feat: state persistence — Terminal + Explorer survive navigation (Zustand stores) 2026-04-02 09:13:25 -03:00
nogueiraguh
8caa032055 feat: OCI CLI Terminal, Spanish i18n, language in My Settings
Terminal:
- New /terminal page with Linux-style terminal UI (dark theme, title bar, prompt)
- OCI Config selector — isolated per user (ownership check)
- Tab autocomplete: parses oci --help dynamically, caches results, commands first
- Command history (↑/↓) persisted in DB per user
- Security: only 'oci' commands, blocks pipes/redirects/shell injection
- Built-in commands: clear, history, help
- Timeout 60s per command

i18n:
- Spanish (es.ts): 748+ keys, Latin American formal
- Language selector moved from sidebar to My Settings (🇧🇷/🇺🇸/🇪🇸)
- Auto-detect browser language (pt/es/en)

Backend:
- POST /api/terminal/execute — run OCI CLI with selected config
- GET /api/terminal/completions — dynamic autocomplete from oci --help
- GET /api/terminal/history — per-user command history
- terminal_history table in SQLite
2026-04-01 17:45:25 -03:00
nogueiraguh
62f2a3d1ab feat: My Settings — password change (local only), timezone, MFA, auth_provider field
- MySettingsPage: timezone, password change (local users), MFA setup/disable
- Password change hidden for federated users (auth_provider != local)
- Federated users see info message: "managed by Oracle IAM"
- Backend: auth_provider + oidc_subject columns in users table (migration)
- /users/me returns auth_provider field
- User interface updated with auth_provider
- i18n: 12 new keys (pt/en) for password change
2026-04-01 15:20:16 -03:00
nogueiraguh
7b50767159 security: Fernet encryption, export sanitization, sensitive settings protection
- Replace base64 _enc/_dec with Fernet (AES-128-CBC + HMAC-SHA256) derived from APP_SECRET
- Auto-migrate legacy base64 data to Fernet on startup (backward compatible)
- Remove all credentials from config export (private keys, passwords, OCIDs, passphrases)
- Block sensitive settings (oidc_*, secret_*) from non-admin read
- Block sensitive settings import
- Import OCI configs as metadata-only (credentials reconfigured manually)
2026-04-01 10:50:51 -03:00
nogueiraguh
0b49c13b4a fix: scope GenAI/OCI config resolution to user — close cross-user fallback leaks
- _resolve_embed_config: new user_id param, scopes all fallback queries to user's own configs
- _get_adb_and_genai: propagates user_id to config resolution
- _chat_start: verify ownership of genai_config_id and oci_config_id
- TF prompt generator: scope default GenAI query to user_id
- Consult embeddings: scope GenAI resolution to user_id
- _search_cis_remediation: include global ADB configs (is_global=1)
2026-04-01 01:30:11 -03:00
nogueiraguh
bc7024c95d feat: user isolation — ownership checks, is_global, per-user embeddings, private reports
- Add is_global column to adb_vector_configs and mcp_servers (schema + migration)
- Add _verify_config_access() and _verify_report_access() helpers
- Apply ownership checks to ~70 endpoints (OCI explore, actions, GenAI, MCP, ADB, reports, embeddings, terraform)
- Reports are 100% private (even admin can't see others')
- Add user_id to embedding metadata + filter in _vector_search/_vector_search_multi
- Remove cross-user ADB fallback in _get_active_adb_configs
- Add auth (token query param) to report HTML and compliance report iframes
- Audit log: admin sees all, user/viewer sees only own
- Embedding task status mapped to user
- Frontend: GLOBAL badge on ADB/MCP configs, hide edit/delete for non-admin on global resources
- Export/import includes is_global field
2026-04-01 01:05:54 -03:00
nogueiraguh
1b3c02d10b feat: v3.0 — CIS PDF chunker, DOCX professional, RAG complete, progress bar, code cleanup
- CIS PDF chunker: segments by recommendation (54/54 complete with desc+rationale+rem), 7000 chars target, 500 overlap
- RAG: 60s timeout + retry, direct SQL fetch by recommendationNumber, concatenate all chunks
- Auto-detect embedding dimension from DDL (empty tables), auto-detect model per dimension
- DOCX: camo strip (Pillow), A4 centered cover, code blocks (Consolas), lists with hanging indent
- Compliance report: progress bar (RAG X/35 percentage), Audit/Verification bold
- Code cleanup: removed redundant imports (io, base64, time, Response, HTMLResponse), duplicate DB query
- EmbeddingsPage: auto-select ADB config fix
- ReportsPage: removed DOCX preview (docx-preview lib)
- README updated to v3.0 with all new features
2026-03-31 10:44:13 -03:00
nogueiraguh
c81909d0a1 fix: DOCX camo strip vivid colors, cover page layout matching PDF, floating image fix
- Camo strip uses exact HTML gradient colors (#6b7f3a, #8a9a4e, #4a6741, #c4a94d) — olive/sage/gold tones
- Fixed floating image in header (parse_xml anchor instead of broken OxmlElement)
- Cover page: removed duplicate ORACLE, title pushed lower, Georgia serif font, Extract date in metadata
- Pillow added to requirements.txt for camo strip generation
2026-03-29 20:58:38 -03:00
nogueiraguh
35a2bf786b feat: OCI Services page, compliance report v3, DOCX with camo strip, timezone per-user
- New OCI Services page with Service Status (auto-detect + overrides) and OCI Health (real-time Oracle status) tabs
- Compliance report: OCI Services section with Cloud Guard recommendations table, back page with Connect with us
- DOCX generation: professional styling with Pillow camouflage strip, green header tables, result boxes
- Separate Download DOCX button in reports page
- Timezone now per-user (not global) — each user configures their own timezone
- ADB connection pre-check before report generation (fail fast 503)
- Compliance report iframe shows friendly HTML instead of JSON 404 during generation
- OCI Health dashboard: proxies ocistatus.oraclecloud.com with search, geo filters, expandable region cards
2026-03-29 00:43:20 -03:00
nogueiraguh
937d0c8318 feat: compliance report v2 — title, disclaimer, level badges, resource tables
- Title: "Oracle Cloud Infrastructure (OCI) CIS Foundations Benchmark Assessment"
- Purpose Statement removed, replaced by single Disclaimer (benchmark standard + legal protection)
- Profile Definitions section added (Level 1 and Level 2 descriptions from CIS page 13)
- Level badge on each finding (green Level 1, orange Level 2)
- Level column in benchmark summary table
- Formatting: pre-wrap + line breaks in description/rationale for long policy text
- Resource tables: up to 7 columns (was 4), shows all useful columns per finding type
- Age calculation: time_created/time_expires shown as "2025-01-16 (434d)"
- OCID display: truncated with start+end visible "ocid1...3ikc3ma"
- Column labels: user-friendly names (User, Key ID, Created (Age), etc.)
- Removed id from skip list, added user_name/fingerprint/time_created to priority
2026-03-26 19:40:09 -03:00
nogueiraguh
19f2df7a7a feat: RAG optimizations — single connection, smart table skip, follow-up context
- Single ADB connection: _vector_search_multi searches all tables with 1 connection (was 11)
- Smart table skip: _relevant_tables matches query keywords to tables, skips irrelevant ones
- Follow-up enrichment: short questions (≤8 words) enriched with previous user message for RAG context
- CIS filter applied to enriched query (follow-up "qual o comando cli?" inherits "cis 1.1" from previous)
- RAG system prompt: remediation must be COMPLETE with CLI commands in code blocks, never summarized
- Table keyword mapping for all 11 tables (IAM, networking, compute, etc.)
- Applied to both Chat Agent and Consultar Embeddings
2026-03-25 09:12:41 -03:00
nogueiraguh
c6b7cd75a9 feat: CIS number in embeddings, tenancy dropdown in consult, text filter for exact CIS search
- Chunk findings CSV: includes CIS Recommendation number, Section, Status in document header
- Consult embeddings: tenancy dropdown (OCI config selector) for filtered search
- CIS number detection: regex extracts "cis X.Y" from query → TEXT LIKE filter for exact match
- Dynamic top_k: 10 per table when CIS filter active (vs 3 default), 15 global results
- Vector search text_filter: combined vector similarity + TEXT LIKE for precise results
- Purged 121174 legacy docs without tenancy metadata from all CIS tables
- Re-embedded 4364 docs across 7 tables with full CIS metadata
- GPT-5.2 for consult (was GPT-4.1), max_tokens 8000
2026-03-24 22:12:15 -03:00
nogueiraguh
a2a9fda6c7 fix: remove gosu (Go 1.24.4 CVEs) — use runuser instead, CRITICAL 4→3, HIGH 12→5 2026-03-23 15:25:54 -03:00
nogueiraguh
e78365f91a fix: reduce container CVEs — update deps and Terraform 1.7.5→1.14.7
- Terraform CLI: 1.7.5 → 1.14.7 (fixes 5 critical Go stdlib CVEs)
- Python deps updated: fastapi>=0.115, uvicorn>=0.34, python-multipart>=0.0.18, PyJWT>=2.10, requests>=2.32, cryptography>=44.0
- Removed pinned versions (use >= for automatic security patches)
- Result: 273 CVEs → 176 CVEs (35% reduction), CRITICAL 9→4, HIGH 63→12
- Remaining CVEs from Chromium and Terraform Go stdlib (upstream, not fixable)
2026-03-23 15:00:33 -03:00
nogueiraguh
87fa92e8cf feat: Chat Agent RAG improvements — auto-detect model, tenancy filter, source hierarchy
- Auto-detect embedding model per table dimension (1536/3072) for search queries
- Embedding cache: reuse same embedding for tables with same model (avoid redundant API calls)
- Tenancy filter: strict JSON_VALUE match, no IS NULL fallback (prevents old data leaking)
- Global tables (cisrecom, engineerknowledgebase): no tenancy filter (generic knowledge)
- ADB connection timeout: 15s connect, 30s query
- RAG context: includes extract_date per document, relevance score, source table name
- Context size: 12000 chars max, distributed proportionally across top 8 docs
- ADB offline handling: LLM informed when bases are unavailable
- System prompt updated: clear hierarchy (findings > cisrecom > engineerknowledgebase)
- RAG vs MCP Tools differentiation: stored data vs real-time scan instructions
- Temporal awareness: model prioritizes recent data, supports date comparison
2026-03-21 13:31:19 -03:00
nogueiraguh
8db3e42d31 feat: detailed embed progress — current section, global bar, queue display
- Backend: tracks current_table, current_inserted, current_total, queue per embed task
- Frontend: dual progress bars (section + global), queue of upcoming sections
- Section bar shows table name + individual progress
- Global bar shows inserted/skipped/total with green/red segments
- Queue shows remaining sections with doc counts
2026-03-21 12:48:31 -03:00
nogueiraguh
ab2d0a3e9b fix: embedding reliability - chunking, truncation, progress bar, shared status
- Text chunking: max 8000 chars per document, large CSV rows split with context header
- Text truncation: _embed_text truncates at 8000 chars before sending to model (prevents 400 errors)
- Purge before re-embed: deletes old docs by tenancy+date before inserting new ones
- Shared embedding status: file-based status (/data/.embed_status/) instead of in-memory dict (fixes multi-worker visibility)
- Progress bar: shows green (OK) + red (failures) segments, percentage, processed/total count
- Better error logging: extracts readable error message from OCI API errors
2026-03-21 10:48:21 -03:00
nogueiraguh
73c60212f7 feat: auto-mapped CIS report embedding, section embed, ADB RAW(16) fix
- Auto-embed report: maps each CSV to its ADB table (summaryreportcsvvector, identityandaccess, networking, etc.)
- Section embed: new endpoint POST /api/embeddings/report/{rid}/section with per-section button in UI
- Table validation: checks registered ADB tables before embedding, reports missing tables
- Auto-detect embedding dimension: reads table dim and selects correct model (3072→large, 1536→small)
- ADB RAW(16) ID fix: all vector inserts use HEXTORAW() for UUID (fixes ORA-01465)
- Float32 vectors: all inserts use array.array('f') for FLOAT32 compatibility
- Embedding status: real-time progress polling (Embedding X/Y — table: Z)
- Loading per section: spinner only on the section being embedded, not all
- Removed individual file embed buttons (only section + full report)
- Summary CSV chunking: groups by CIS section with tenancy + extract_date metadata
- Findings CSV chunking: each row becomes a document with structured content
- README: documented all 11 required ADB vector tables with descriptions
2026-03-21 00:10:50 -03:00
nogueiraguh
2c5f0f2e1c fix: compliance report iframe, findings tables, PDF fonts, delete session, orphan markers
- Compliance report iframe: removed auth requirement (UUIDs are non-guessable), fixed X-Frame-Options SAMEORIGIN on /api/
- Findings resource tables: compact HTML tables (max 4 cols, 10 rows) per non-compliant finding with affected resources from CSV
- PDF fonts: installed Liberation + DejaVu fonts in container, standardized font-family to Arial/Liberation Sans
- Delete session fix: terraform.ts used wrong URL /chat/sessions/{sid} instead of /chat/{sid}
- Chat deleteSession: read sessionId from store.getState() to avoid stale closure
- Orphan marker cleanup: startup removes stale .compliance_generating markers, status endpoint auto-expires after 10min
- Generate endpoint rejects duplicate requests while already generating
- Compliance iframe condition: only renders when ready AND not generating, prevents 404 flash
- Dockerfile: added fonts-liberation fonts-dejavu-core fontconfig packages
2026-03-20 17:17:42 -03:00
nogueiraguh
fbcb1966d5 feat: comprehensive security, performance, UX and deployment audit
Security:
- CORS restricted to explicit methods/headers, configurable via CORS_ORIGINS env
- Auth added to /reports/{rid}/html and /compliance-report endpoints
- Ownership check on report downloads
- Rate limiting on login (10 attempts/5min per IP with threading.Lock)
- Non-root container user (agent via gosu entrypoint)
- Nginx security headers (X-Frame-Options, X-Content-Type-Options, X-XSS-Protection, Referrer-Policy, Permissions-Policy)
- .gitignore and .dockerignore for secret leak prevention
- .env.example with documentation

Performance:
- 16 SQLite indexes on foreign keys and frequently queried columns
- Pagination on chat messages (100), reports (50), audit log (100)
- subprocess.run wrapped in run_in_executor (3 async handlers)
- asyncio.wait_for timeouts on GenAI calls (300s) and Chromium PDF (120s)
- Thread pool reduced to 10 workers
- Code splitting with React.lazy (bundle: 1.3MB -> ~550KB initial)
- React.memo on TreeItem (recursive compartment tree)

Error handling:
- 13 bare except clauses replaced with logged Exception handlers
- Graceful shutdown handler (terminates subprocesses + executor)
- File upload validation (50MB max, extension whitelist per endpoint)
- Health check expanded (version, uptime, db_ok)
- Cache-Control on /api/genai/models (1h)
- Auto-cleanup audit_log > 30 days

Dead code removed:
- DownloadsPage.tsx, StubPage.tsx, MfaPage.tsx (moved to UsersPage)
- Legacy frontend/ directory
- 19 unused i18n keys, dist/ removed from git tracking

UX & i18n:
- 8 alert() calls replaced with styled error states (TerraformPage)
- 50+ hardcoded Portuguese strings localized to i18n (pt/en) across 11 files
- aria-label on all icon-only buttons (Chat, Explorer, Sidebar)
- focus-visible CSS for keyboard navigation
- Responsive grid fix (360px -> 280px for mobile)
- aria-hidden on decorative SVGs

Deployment:
- Docker resource limits (backend 4G, frontend 512M)
- Log rotation (json-file, 10MB x 3)
- Terraform version parameterized via ARG
2026-03-20 13:48:30 -03:00
nogueiraguh
61fbb3861d feat: remove legacy frontend, root routing, compliance ZIP with Chromium PDF, chat markdown styling
- Legacy frontend removed: React SPA served at / (no /app/ prefix)
- Compliance report ZIP: Chromium headless --print-to-pdf (identical to browser) + CSV findings
- Server-side generation state: .compliance_generating marker survives page navigation
- RAG enriched: Description + Rationale + Remediation + Audit extracted from CIS vector chunks
- Chat markdown: syntax highlighting (Catppuccin), styled headings/lists/tables/blockquotes/code
- Default model auto-selected on Chat Agent load
2026-03-20 07:21:41 -03:00
nogueiraguh
5028f632a6 fix: compliance report Oracle design, polling robustness, print margins
- Oracle PDF style: decorative left strip, ORACLE brand header, red section titles, green table headers
- Cover page: removed rectangle, clean layout matching Oracle reference PDF
- Print: @page margin:0 + thead/tfoot table trick for per-page header/footer spacing without browser URL/date
- RAG remediation: fixed fallback dumping entire CIS chunk instead of just remediation section
- Findings: removed break-inside:avoid that caused empty pages, emoji replaced with [CSV] text
- Tables: break-inside:avoid on rows, section headers break-after:avoid, thead repeats on page break
- Compliance polling: useEffect-based with cleanup, auto-expand on ready, re-check on section toggle
- Explorer: silent polling during start/stop (no flickering)
- HTML report starts minimized, auto-expands on fresh generation
- Include dist/ in git for deployment
2026-03-19 11:34:31 -03:00
nogueiraguh
442e710b9f feat: LAD A-Team CIS Compliance Report, React SPA, i18n, report management, explorer UX fixes
- Professional Oracle-format compliance report with RAG remediation from ADB vector store
- React 19 SPA at /app/ (16 pages, TypeScript, Vite, Zustand, i18n pt/en 625 keys)
- Report delete endpoint, embed individual report files into vector store
- Terraform ZIP download (client-side, pure JS)
- Explorer silent polling during start/stop (no flickering)
- HTML report and compliance report sections start minimized
- Token auth fix for compliance report CSV download links
2026-03-19 07:34:06 -03:00
nogueiraguh
baacc1ba21 feat: session token auth, workspace submenu, retry buttons, terraform fixes, app rename
- Rename app to "AI Agent - Infrastructure & Security Engineer"
- OCI session token authentication (SecurityTokenSigner, conditional form, type tags)
- Terraform Workspaces sidebar sub-tab (date-grouped accordion, INNER JOIN filter)
- Retry button on failed messages (Chat, Terraform, Prompt Generator)
- Fix f2 undefined in dedup, oci_core_services false validation, Re-plan tfCode sync
- Auto-fix button no longer requires pre-selected model
- DRG attachment rules added to Terraform system prompt
- Stuck workspace recovery on container restart
2026-03-12 18:39:35 -03:00
nogueiraguh
18fabec805 feat: Explorer KPI stats, enhanced views, start/stop expansion, Prompt Generator docs injection
- Explorer: KPI stats bar with cached counts (SQLite), background refresh,
  enhanced views for VCNs/Subnets/LBs/Buckets, start/stop for DB Systems,
  MySQL, Container Instances, dead state filtering across all 36 endpoints
- Prompt Generator: same knowledge pipeline as Terraform Agent — resource
  type detection + official docs from GitHub + compact resource reference
- Fix: NetworkFirewallPolicySummaryCollection not iterable (.items accessor)
2026-03-12 11:24:38 -03:00
nogueiraguh
981f77b1eb fix: Terraform Agent uses SQLite RAG only, terminal shows errors properly
- Skip ADB vector search for Terraform Agent (uses local SQLite resource reference instead)
- Show error message in terminal when plan fails validation (no more stuck "Aguardando execução")
- Write region validation error to plan_output field for terminal display
- Fix Plan/Re-plan button visibility for all workspace states (including stuck planning/applying)
2026-03-12 08:45:54 -03:00
nogueiraguh
e4ba2cfaab feat: region safety guard, rollback button, SSH key support, split-panel layout
- Block terraform plan if model omits variable "region" (prevents wrong-region provisioning)
- Rollback button on apply failure with ROLLBACK confirmation modal
- SSH public key field in OCI configs, auto-injected into terraform.tfvars
- Split-panel layout: terminal right (40%), files/plan/resources below chat (60%)
- reasoning_effort uppercase fix for OCI SDK
- Plan button persists after destroy status
2026-03-12 00:26:13 -03:00
nogueiraguh
58d430c904 feat: terraform prompt generator, provider parameter matrix, and model penalties
- Add Terraform Prompt Generator: AI-powered structured prompt generation
  with dedicated chat UI, curated model selection (7 models), conversation
  history with persistent sessions, and OCI TF resource reference context
- Provider parameter matrix: segment API params per model/provider,
  explicitly null unsupported params (freq/pres penalty, temperature)
  to prevent OCI SDK serialization errors
- Add penalties flag to model catalog: only GPT-4.1/4.1-mini/4o support
  frequency_penalty and presence_penalty
- Flat workspace enforcement: prohibit module blocks and duplicate
  variable declarations in Terraform system prompt
- Prompt Generator history: sidebar panel with session persistence,
  restore, rename/delete (agent_type tf-prompt)
2026-03-11 13:55:59 -03:00
nogueiraguh
ab38e93516 feat: dedicated consult prompt and enriched document content extraction
- Add CONSULT_SYSTEM_PROMPT (concise data viewer, not compliance assistant)
- Add _enrich_doc_content to extract text from metadata.text when TEXT column is short
- Enriches context with recommendation number, chapter, tenancy, section
- Improves RAG context quality for all vector search flows
2026-03-11 10:31:24 -03:00
nogueiraguh
0e8e082b1a feat: auto-resolve GenAI config for consult embeddings endpoint
- Build GenAI config from OCI credentials when no genai_configs exist
- Uses GPT-4.1 as default model with RAG system prompt
- Fixes _call_genai signature (system_prompt via gc dict, not kwarg)
2026-03-11 03:20:04 -03:00
nogueiraguh
587a809156 feat: auto-detect embedding dimensions per table in consult endpoint
- Detect VECTOR_DIMENSION_COUNT per table before querying
- Map dimensions to correct embedding model (1536→small, 3072→large)
- Cache query embeddings by dimension to avoid redundant API calls
- All tables now searchable regardless of which model generated them
2026-03-11 03:12:57 -03:00
nogueiraguh
749f4e479b feat: consult embeddings UI, vector search FLOAT32 fix, and base64 compartment decode
- Add Consult Embeddings sub-menu with chat-like Q&A interface
- Fix VECTOR_DISTANCE FLOAT32/FLOAT64 mismatch (array 'd' → 'f')
- Decode base64 compartment_id in _resolve_embed_config
- Sidebar sub-item navigation for Embeddings hierarchy
- Fallback to raw document display when no GenAI config available
2026-03-11 03:06:53 -03:00
nogueiraguh
2a56712665 fix: sqlite3.Row.get() compatibility in _resolve_embed_config 2026-03-11 02:36:07 -03:00
nogueiraguh
4a802c8e64 feat: knowledge base with URL import, ADB case-sensitivity fix, and RAG enhancements
- Add Knowledge Base (Base de Conhecimento) with file upload + URL import
- URL content extraction: HTML stripping, remote PDF parsing
- Auto-resolve embedding config from OCI credentials
- Case-insensitive ADB table matching with quoted identifiers
- Table validation endpoint, report_date metadata, purge & re-embed flow
- Embeddings tab cleanup, PyPDF2 dependency, README updated to v2.3
2026-03-11 02:02:31 -03:00
nogueiraguh
851def30b6 feat: Terraform intelligence, anti-flickering, and v2.2 release
- Official resource docs injection from registry.terraform.io (on-demand fetch + SQLite cache)
- Smart tfvars auto-generation from declared variables (tenancy_ocid, user_ocid, etc.)
- Multi-region provider: use var.region instead of hardcoded OCI config region
- RPC anti-cycle rule in system prompt
- System prompt auto-sync to DB on restart
- Fix UI flickering: animations scoped to tab switch only (tab-enter class)
- Terraform polling timeout increased to 60 min
- Terminal output updates without full page re-render
- Fix ${IC.bot} literal rendering in chat empty state
- Chat empty state icon scaled to 48px
- README updated to v2.2 with all changes
2026-03-10 14:29:38 -03:00
nogueiraguh
4fc458cdcb feat: UI modernization phases 1B-5, KPI dashboard, charts, and ADB fix
- Phase 1B: replace all emojis with inline SVG icons (Lucide-based, 45+ icons)
- Phase 2: KPI cards for compliance reports (score, passed, failed, total)
- Phase 3: Chart.js integration (donut distribution + horizontal bar by section)
- Phase 4: SVG gauge/speedometer for compliance score with gradient arc
- Phase 5: polish animations (fade-in stagger, smooth theme transition, hover effects, skeleton loading, alert slide-in, button press, dropdown animation)
- New endpoint GET /api/reports/{rid}/summary for KPI data extraction
- Fix ADB wallet connection (DPY-6005) by always passing wallet_password
- Remove CIS_EMBEDDINGS default from ADB config
- Custom brain icon (Lucide) for GenAI section
2026-03-10 00:08:28 -03:00
nogueiraguh
188fc82858 feat: export/import configuration and multiple bug fixes
- Add export/import endpoints for full config backup (OCI, GenAI, MCP, prompts, settings, ADB)
- Export includes private keys (base64) for complete environment migration
- Import merges by ID (skips existing, no duplicates)
- Fix Resource Plan parser to recognize free-form format (model skips ```plan blocks)
- Fix replan not clearing previous apply/destroy outputs
- Fix duplicate CIS Compliance Scanner MCP server on multi-worker startup
- Add Terraform prompt editor with auto-save in menu
2026-03-09 15:26:13 -03:00
nogueiraguh
c4a9f8d6d5 feat: ADB network access, prompt editor, resize persistence, and multiple fixes
- Add Update Network Access endpoint and UI for ADB ACL management
- Add inline prompt editor with auto-save in Terraform agent menu
- Persist resize bar positions across re-renders (Explorer + Terraform)
- Restore full Terraform session state from history (files, plan, outputs, OCI config)
- Parse free-form Resource Plan format (model often skips ```plan blocks)
- Auto-refresh resource state after Start/Stop actions
- Clear previous apply/destroy outputs on Re-plan
- Deduplicate CIS Compliance Scanner MCP server on startup
- Show ACL IPs in Explorer for Autonomous Databases
- Detect user IP via /api/oci/my-ip endpoint
2026-03-09 15:01:26 -03:00
nogueiraguh
33d1e2ddbf refactor: simplify Terraform agent system prompt 2026-03-09 01:25:32 -03:00
nogueiraguh
a5b8f6903a feat: resource type validation, 100K max tokens, and auto-split improvements
- Add SQLite-based resource type validation with suggestions for invalid types
- Increase Terraform max_tokens from 32K to 100K for large infra generation
- Generate resource reference at startup to survive volume mount overwrites
- Add invalid resource type examples to system prompt (RPC peer, subnet route table)
- Add prompt size logging for Terraform agent
- Translate remaining Portuguese code comment to English
2026-03-09 01:10:33 -03:00
nogueiraguh
6fb2eecddf feat: auto-split monolithic Terraform files and fix single-line HCL blocks
- Add 3-layer protection pipeline for model-generated Terraform code:
  1. Frontend auto-split: splits monolithic HCL into multiple files by resource type
  2. Backend auto-split: Python port as last defense before writing to disk
  3. Backend deduplication: removes monolithic leftovers with duplicate resources
- Fix single-line block expansion to handle ALL HCL blocks (nested included):
  ingress_security_rules, egress_security_rules, route_rules, match_criteria, etc.
- Add prompt size logging for terraform agent diagnostics
- Strengthen system prompt: minimum 3 files, final reminder section
2026-03-09 00:40:48 -03:00
nogueiraguh
15a8366f9c fix: delete terraform workspace and files when deleting chat session 2026-03-08 19:09:28 -03:00
nogueiraguh
c2effa1408 fix: include private_key_password in provider.tf for encrypted OCI keys 2026-03-08 19:06:03 -03:00
nogueiraguh
28a8fe4511 fix: add explicit security rules multi-line example to TF validation checklist 2026-03-08 19:03:27 -03:00
nogueiraguh
1b726b1a51 fix: clarify variable region requirement in TF validation checklist 2026-03-08 19:01:05 -03:00