diegosouzapw
1196d08aad
test(mitm): handlers + targets + detection unit tests (F3)
...
- mitm-handler-base: hookBufferStart returns InterceptedRequest with
sanitized headers, extractSourceModel parses body.model, writeError
emits JSON with sanitized message (Hard Rule #12 ).
- mitm-handler-<id>: nine per-agent happy-path tests (antigravity,
kiro, copilot, codex, cursor, zed, claude-code, open-code) exercise
full intercept() with mocked fetch via _mitmHandlerHarness.ts;
asserts mapped model is forwarded and AgentBridge correlation
headers are present. Trae test confirms intercept() rejects with a
structured error.
- mitm-targets-resolve: ALL_TARGETS contains 9 entries; resolveTarget
is case-insensitive and returns null for unknown hosts.
- mitm-targets-route: bypass > target > passthrough precedence
validated against representative hostnames.
- mitm-detection: DETECTORS covers every AgentId; detectAgent never
throws and returns DetectionResult-shaped objects for all probes.
2026-05-27 22:33:56 -03:00
diegosouzapw
1ca703657a
feat(cli): add shared CLI UI components — CliToolCard/ConceptCard/ComparisonCard/BaseUrlSelect/ApiKeySelect/ManualConfigModal + useToolBatchStatuses hook (plan 14 F4)
2026-05-27 22:32:27 -03:00
diegosouzapw
f211fcf509
merge: F7 enforce wiring (chatCore PRE/POST + combo soft penalty + spendRecorder)
2026-05-27 22:23:33 -03:00
diegosouzapw
c04aec0550
merge: F5 ComplianceTab actor filter + CompressionLogTab namespace fix
2026-05-27 22:23:31 -03:00
diegosouzapw
d78e33858d
test(quota): cover enforce 7 scenarios + spendRecorder fail-open (B/F7)
...
quota-enforce.test.ts — 8 assertions:
- Scenarios 1/7: fail-open when DB unavailable (no pool, store errors).
- Scenarios 2-6: generous/strict/soft/burst/cap-absolute via fairShare integration.
- Extra: Promise.all with multiple inputs always resolves to valid kind shape.
quota-spend-recorder.test.ts — 5 assertions:
- Fire-and-forget timing, silent no-op for unknown keys, rejection catch,
no-logger path, usd cost type accepted.
2026-05-27 22:17:44 -03:00
diegosouzapw
2b47a81d54
merge(F7): integrate W3 frente F7 into base
2026-05-27 22:17:26 -03:00
diegosouzapw
0e357a9cc7
merge(F6): integrate W3 frente F6 into base
2026-05-27 22:17:24 -03:00
diegosouzapw
95312401b6
merge(F5): integrate W3 frente F5 into base
2026-05-27 22:17:23 -03:00
diegosouzapw
1d44f5d35d
merge(F4): integrate W3 frente F4 into base
2026-05-27 22:17:21 -03:00
diegosouzapw
07605d05cb
Merge F4 (NewBatchWizard 4-step modal + tests) into orchestrator branch
...
# Conflicts:
# src/app/(dashboard)/dashboard/batch/components/NewBatchWizard.tsx
2026-05-27 22:11:12 -03:00
diegosouzapw
56d1418de7
Merge F4 (NewBatchWizard 4-step modal + tests) into orchestrator branch
2026-05-27 22:10:40 -03:00
diegosouzapw
14d4c7cbcd
test(agent-skills): unit tests for AgentSkillsPageClient + filters + selection
2026-05-27 22:10:19 -03:00
diegosouzapw
9607225a16
test(ui): cover ComplianceTab actor filter + CompressionLogTab namespace (B/F5)
...
- compliance-tab-actor-filter.test.tsx: 4 tests verifying actor input
presence, initial fetch has no actor param, re-fetch with actor=X
after typing, and clearFilters does not throw.
- compression-log-namespace.test.tsx: 4 tests verifying that the logs
namespace is used (not settings), no _MISSING_ sentinels, and all 4
required keys are covered.
2026-05-27 22:07:30 -03:00
diegosouzapw
e404649d43
feat(batch): add concept card, New batch button, cost/expiration columns, row actions, 30s polling on /batch (F6)
2026-05-27 22:05:30 -03:00
diegosouzapw
c45781f0d6
test(audit): cover timeline helpers + audit-log level filter + activity page redirect (B/F4)
2026-05-27 22:01:23 -03:00
diegosouzapw
4a97b419ae
test(mcp): unit tests for agentSkillTools
2026-05-27 21:58:22 -03:00
diegosouzapw
fb0ac17835
test(playground): improve branch coverage to 100% for codeExport and promptImprover
...
Add tests for default branch paths (model/prompt/stream falsy), completions
params branch, search with model set, web.fetch depth=0, reversed markers
in parseImprovedContent. All new production files reach 100% branch coverage.
2026-05-27 21:57:34 -03:00
diegosouzapw
d1d0ddda0f
test(agent-skills): unit tests for generator + scripts smoke
...
20 tests covering:
- dry-run produces report without writing (filesystem unchanged)
- apply writes SKILL.md for API and CLI skills with correct sections
- apply writes all 42 skills when no filter
- idempotency: second run reports 0 generated, all unchanged
- prune dry-run detects orphans without deleting
- prune apply deletes orphan dirs, preserves catalog dirs
- marker preservation: custom block survives regeneration
- buildSkillMarkdown: valid shape, no escape errors, correct sections per category
- onlyIds filter limits generation
- report shape validation
Also adds gray-matter as dependency (per plan prerequisite check).
2026-05-27 21:55:01 -03:00
diegosouzapw
b7efba4727
test(agent-skills): unit tests for REST routes with sanitization assertions
...
16 tests covering all 5 endpoints:
- GET /agent-skills: 42 total, category/area filters, invalid category → 400
- GET /agent-skills/[id]: found api+cli skills, unknown → 404
- GET /agent-skills/[id]/raw: unknown → 404, valid → 200/502/500 (network-tolerant)
- GET /agent-skills/coverage: SkillCoverage shape (api.total=22, cli.total=20)
- POST /generate: no auth → 401/403, invalid body → 400, no generator → 503
Hard Rule #12 verified explicitly in every error case: error.message must
not match /\bat \/|\bat file:\/\// (no stack trace exposure). Final test
collects all error paths and asserts sanitization in a single sweep.
2026-05-27 21:49:32 -03:00
diegosouzapw
754806e0f8
test(a2a): unit tests for listCapabilities + Agent Card route
...
Adds 6 tests for executeListCapabilities (§3.7 shape, 42-skill IDs in markdown,
coverage bounds, ISO datetime, handler registration) and 5 tests for the Agent
Card route (6 skills total, list-capabilities presence + tags + examples, all
original 5 skills preserved). All 11 pass.
2026-05-27 21:49:03 -03:00
diegosouzapw
75b3e916bc
test(inspector): unit tests for F4 inspector core (7 specs)
2026-05-27 21:44:53 -03:00
diegosouzapw
c1952db4cb
feat(cli-tools): add /api/cli-tools/all-statuses batch endpoint + mtime cache + DRY checkToolConfigStatus (plan 14 F2)
...
- Extract checkToolConfigStatus() from /api/cli-tools/status/route.ts → src/lib/cliTools/checkToolConfigStatus.ts (DRY, sentinel comment, optional configPathOverride for tests)
- Create batchStatusCache.ts singleton in-memory Map<toolId,{mtimeMs,result}> (getCached/setCached/invalidate/clearCache)
- Create /api/cli-tools/all-statuses GET route: auth via requireCliToolsAuth, iterates CLI_TOOLS, Promise.allSettled per tool, timeout 5s, mtime-based cache, endpoint extraction, lastConfiguredAt merge, buildErrorBody on error path
- Update /api/cli-tools/status/route.ts to import from new module (no behavior change)
- 27 unit tests (batch-status-cache + check-tool-config-status) + 8 integration tests (all-statuses-route) — all passing
2026-05-27 21:43:44 -03:00
diegosouzapw
6c7242cca3
test(playground): add test coverage for codeExport, promptImprover, schemas, markdown
...
- playground-code-export.test.ts: 20 tests, table-driven per endpoint×language,
security invariants ($OMNIROUTE_API_KEY present, no real keys)
- playground-prompt-improver.test.ts: 19 tests (buildImproveChatBody 6 scenarios,
parseImprovedContent 8 cases, schema validation 5 cases)
- playground-schemas.test.ts: 20 tests round-trip for all Zod schemas
- search-tools-schemas.test.ts: 19 tests (SearchProviderCatalogItem/Response/ScrapeResult)
- markdown-message.test.tsx: 8 vitest tests (code block, table, list, link, XSS safety)
Total: 86 tests, all passing
2026-05-27 21:29:18 -03:00
diegosouzapw
f27911fd4a
feat(batch): add NewBatchWizard (4-step modal: destination, input, validate, cost) + tests (F4)
2026-05-27 21:27:50 -03:00
diegosouzapw
44b248314b
merge(F8): move skills→omni-skills + split into 8 components + inspector
2026-05-27 21:26:38 -03:00
diegosouzapw
b1a127a732
test(omni-skills): unit tests for OmniSkillsPageClient and components
...
46 structural/source-pattern tests covering: file structure, page.tsx server
component contract, PageClient 4-tab wiring, OmniSkillCard accessibility,
SkillInspectorPane 4 sub-tabs + API fetches, OmniSkillsList split layout,
OmniExecutionsTab columns, OmniSandboxTab config values,
OmniMarketplaceTab dual-provider logic, and E2E path update.
2026-05-27 21:24:15 -03:00
diegosouzapw
b9e5d940a4
merge: F6 QuotaStore core (sqlite + redis drivers + fairShare + planResolver + burnRate + saturation)
2026-05-27 21:14:01 -03:00
diegosouzapw
fb519b2002
feat(translator): add StreamTransformerAccordion (F5)
...
- Refactor of StreamTransformerMode wrapped in Collapsible with lazy-render
- Preserves rawSse input, transform button, MiniStat output, copy
- POST /api/translator/transform-stream reused unchanged
- D7 lazy-render
2026-05-27 20:50:51 -03:00
diegosouzapw
de7c0c6bba
feat(translator): add CompressionPreviewAccordion (F7)
...
- Extracted Compression Preview from PlaygroundMode lines 506-584 into standalone accordion
- Wrapped in Collapsible with lazy-render (D7): content only mounts after first open
- Accepts inputContent via prop (lifted from TranslateTab in F9) or shows empty-state hint
- POST /api/compression/preview unchanged; error path sanitized (no stack-trace leak)
- 33 Vitest tests covering smoke, lazy-render guard, mode select, fetch dispatch, result grid, error path
2026-05-27 20:46:55 -03:00
diegosouzapw
d7372dea3f
feat(translator): add MonitorTab (F8)
...
- Refactor of LiveMonitorMode with paridade
- ADD: monitorOriginHint header explaining event origin
- ADD: empty state with CTA 'Ir para Translate' (onGoToTranslate)
- Preserves 3s polling /api/translator/history, auto-refresh toggle, stats, table
- cleanup useEffect preserved
2026-05-27 20:40:31 -03:00
diegosouzapw
22123013be
test(quota): cover fairShare 10 scenarios + burnRate + planResolver + saturationSignals + storeFactory (B/F6)
2026-05-27 20:39:09 -03:00
diegosouzapw
d5d9b5c839
test(quota): cover redisQuotaStore mock (gated by RUN_QUOTA_REDIS_INT) (B/F6)
2026-05-27 20:38:57 -03:00
diegosouzapw
c647f854e8
test(quota): cover sqlite store concurrency + sliding window rotation (B/F6)
2026-05-27 20:38:49 -03:00
diegosouzapw
15838348c3
test(agent-skills): unit tests for catalog + openapi + cli parsers
...
agentSkills-catalog.test.ts (30 tests):
- getCatalog(): 42 total, 22 api, 20 cli
- API_SKILL_IDS/CLI_SKILL_IDS length assertions
- ID regex format, uniqueness, required fields
- getSkillById happy path + null for unknown/empty
- filterCatalog by category, area, combined, empty
- refreshCatalog() invalidates cache (new array reference)
- computeCoverage() shape validation
- rawUrl/githubUrl URL format assertions
agentSkills-openapiParser.test.ts (9 tests):
- Fixture YAML: paths Map, area groupings (providers, api-keys, inference)
- OpenapiPath field validation
- Missing file throws
- Empty paths YAML returns empty Maps
- Real openapi.yaml: providers area ≥5 endpoints (integration)
agentSkills-cliRegistryParser.test.ts (10 tests):
- Fixture .mjs: commands Map, families Map, ≥5 provider subcommands
- Description extraction, isSubcommand flag, flags extraction
- Skips unrecognised files, throws on missing dir
- Real providers.mjs: ≥5 commands (integration)
2026-05-27 20:32:08 -03:00
diegosouzapw
8dbd0a9d1c
feat(translator): add TestBenchAccordion (F6)
...
- Refactor of TestBenchMode wrapped in Collapsible with lazy-render (D7)
- Preserves 8 scenarios, runAll, per-scenario re-run, pass/fail badges, compatibility report
- Reuses useProviderOptions + useAvailableModels (D12)
- POST /api/translator/translate + /api/translator/send unchanged
- Hard Rule #12 : error display uses err.message only (no stack trace)
- 17 Vitest tests: smoke render, lazy-render guard, Run All 8 fetches,
results running→pass, per-scenario re-run, error sanitization
2026-05-27 20:27:51 -03:00
diegosouzapw
150fe98ddd
feat(batch): add UploadFileModal + Used by column + Concept card on /batch/files (F5)
...
- Create UploadFileModal: drag/drop + click-to-pick, .jsonl + 512MB validation, purpose=batch upload, D14 error sanitization, Escape key handler
- Modify files/page.tsx: integrate FilesConceptCard (F3) + Upload toolbar button + UploadFileModal wired to fetchAll refresh
- Modify FilesListTab.tsx: add "Used by" column (D12 — derives related batches client-side), download button per row, delete button with canDelete guard (terminal-only or no related batches), colspan updated 6→8
- Create UploadFileModal.test.tsx (9 tests, all passing): render, invalid ext, valid .jsonl, >512MB (size property mock), upload 200 → onUploaded, upload 500 → sanitized error, Escape→onClose, drag-drop, sanitization assert (no /home/ in alert text)
2026-05-27 20:25:43 -03:00
diegosouzapw
bb200cd0ba
Merge branch 'feat/translator-friendly-concept-card-F2' into refactor/pages-v3-19-translator-friendly-redesign
2026-05-27 19:56:38 -03:00
diegosouzapw
88899971d1
test(sidebar): cover Monitoring reorg, Costs section, back-compat (B/F3)
...
Three new test files:
- sidebar-monitoring-reorg.test.ts: asserts monitoring has 4 children (activity item + logs/audit/system groups), no costs-parameters group, no logs-activity in items
- sidebar-costs-section.test.ts: asserts costs section exists with 4 items in correct order, costs removed from analytics, costs positioned between analytics and monitoring
- sidebar-back-compat.test.ts: asserts activity added + logs-activity preserved in HIDEABLE_SIDEBAR_ITEM_IDS, admin preset shows activity and hides logs-activity (B30)
2026-05-27 19:51:49 -03:00
diegosouzapw
e98ba91928
refactor(sidebar): split Monitoring into Logs/Audit/System groups + Activity at top (B/F3)
...
- MONITORING_ITEMS reduced to single `activity` item at `/dashboard/activity`
- New LOGS_GROUP (logs/logs-proxy/logs-console) extracted from flat monitoring items
- New SYSTEM_GROUP (health/runtime) extracted from flat monitoring items
- AUDIT_GROUP preserved unchanged
- Monitoring section children: [...MONITORING_ITEMS, LOGS_GROUP, AUDIT_GROUP, SYSTEM_GROUP]
- COSTS_PARAMS_GROUP removed from monitoring section (items migrate to COSTS_ITEMS)
- `activity` added to HIDEABLE_SIDEBAR_ITEM_IDS; `logs-activity` preserved for back-compat (B11)
- Updated existing sidebar-visibility.test.ts to match new monitoring item structure
2026-05-27 19:51:30 -03:00
diegosouzapw
193bf1a766
feat(cli-tools): extend catalog with category/vendor/acpSpawnable/baseUrlSupport + new entries (plan 14 F1)
...
- Add CliCatalogEntrySchema (Zod) + CliCatalogEntry type + CliCatalogSchema in src/shared/schemas/cliCatalog.ts
- Add ToolBatchStatus + ToolBatchStatusMap interfaces in src/shared/types/cliBatchStatus.ts
- Re-export cliBatchStatus from src/shared/types/index.ts
- Extend all CLI_TOOLS entries with 4 new fields: category, vendor, acpSpawnable, baseUrlSupport
- Add 13 new entries: roo, jcode, deepseek-tui, smelt, pi (code), aider, forge,
gemini-cli, cursor-cli (code), goose, interpreter, warp, agent-deck (agent)
- Remove windsurf and amp (MITM backlog plan 11, D17)
- Result: 19 visible code entries + 6 agent entries (D15 cardinality)
- Add 5 new unit tests: cli-catalog-schema, cli-catalog-counts, cli-catalog-newentries,
cli-catalog-removed, cli-catalog-acpspawnable
- Update existing tests to align with removed entries
2026-05-27 19:50:38 -03:00
diegosouzapw
269fce6f0b
feat(batches): add pure helpers — csvToJsonl, validateJsonl, costEstimator, retryFailed (F2)
2026-05-27 19:42:51 -03:00
diegosouzapw
ddf6b0ef63
merge(F2): DB migrations + modules into Group A parent
2026-05-27 19:41:11 -03:00
diegosouzapw
97d607e7c5
test(mitm/inspector): unit tests for F1 foundation utilities
...
83 tests across 7 files: mitm-masksecrets (9), mitm-passthrough (10),
mitm-upstream-trust (5), inspector-kind-detector (14), inspector-context-key (11),
inspector-types (11), shared-schemas (23). All green.
2026-05-27 19:39:37 -03:00
diegosouzapw
ae0941464f
feat(translator): add F1 foundation types, hooks, and i18n keys
...
- types.ts: FormatId, TranslatorTab, TranslateMode, AdvancedSlug, TranslateDeepLink, TranslateNarratedResult, AdvancedAccordionProps, ExampleTemplate
- useTranslateDeepLink hook (URL ?tab/mode/advanced enum-validated parsing + setTab/setMode/setAdvanced)
- useTranslateSession hook (detect+translate+send orchestration with sanitized errors)
- 52 new i18n keys (en + pt-BR) under namespace 'translator' (ADD-only, no old keys removed)
- 3 unit test files: deeplink (32 tests), session (10 tests), i18n-keys (138 tests)
2026-05-27 19:38:34 -03:00
diegosouzapw
3c50ebce8f
merge: F2 DB migrations + modules (pools, consumption, plans)
2026-05-27 19:25:12 -03:00
diegosouzapw
80fa37f30f
test(db): unit tests for F2 modules
2026-05-27 19:24:30 -03:00
diegosouzapw
bf764dc529
test(agent-skills): unit tests for schemas + SkillsConceptCard
2026-05-27 19:23:36 -03:00
diegosouzapw
e827ac125a
feat(translator): add TranslatorConceptCard with flow diagram (F2)
...
- TranslatorConceptCard: headline, analogy, expandable 'how it works'
- TranslateFlowDiagram: pure HTML/CSS responsive diagram (D10)
- translateOrFallback inline (D19 — no shared fallback file)
- Tooltip on technical terms (D20 a11y: aria-expanded + aria-controls)
2026-05-27 19:15:50 -03:00
diegosouzapw
75b02f6419
test(db): cover pools, consumption, plans, and migrations idempotency (B/F2)
...
Adds 44 tests across 4 files:
- db-quota-pools.test.ts (16 tests): CRUD lifecycle, upsertAllocations
replace strategy, FK CASCADE, listAllocationsForApiKey cross-pool.
- db-quota-consumption.test.ts (12 tests): getBucket, incrementBucket
atomic (100 concurrent), getPair, gcOlderThan boundary semantics.
- db-provider-plans.test.ts (10 tests): upsertPlan idempotence,
getPlan JSON parsing, listPlans, deletePlan.
- db-quota-migrations-idempotency.test.ts (6 tests): schema assertions
and double-run idempotency for migrations 073-075.
2026-05-27 19:14:51 -03:00
diegosouzapw
b2cd0d69bb
test(db): cover playgroundPresets CRUD + idempotent migration
...
18 tests: migration idempotency, both indexes exist, full CRUD lifecycle,
params JSON round-trip, UUID v4 validation, not-found paths (null/false),
timestamp preservation, corrupted params_json recovery, patch of each
scalar field individually, empty patch no-op.
2026-05-27 19:05:37 -03:00