Full-stack worker for Docker infrastructure, TypeScript tool replacement, and test updates
NOTE: Startup and cleanup are handled by worker-base. This skill defines the WORK PROCEDURE.
Features involving:
None — all work uses standard file editing tools and shell commands.
Read the feature description, preconditions, expectedBehavior, and verificationSteps thoroughly. Read AGENTS.md for mission boundaries. Read .factory/library/architecture.md for system context.
Before writing anything, read all files you will modify AND all files that import from those files. Understand the current interfaces, types, and calling patterns.
For TypeScript features:
app/backend/tests/externalTools.test.ts) to understand conventionscd app/backend && bun test tests/externalTools.test.ts to confirm tests fail (red)For Docker features:
Write the implementation to make tests pass. Key guidelines:
SearchResult and FetchResult types must not changeprocess.env.SEARXNG_URL for SearXNG endpointbun add <package>Run tests again to confirm they pass:
cd /home/nima/dana/app/backend && bun test tests/externalTools.test.ts
Then run the full test suite to check for regressions:
cd /home/nima/dana/app/backend && bun test
For search/fetch features:
cd /home/nima/dana/app/backend && bun -e "import { webSearch } from './src/tools/external/webSearch'; webSearch('test').then(r => console.log(JSON.stringify(r, null, 2)))"For Docker features:
docker compose config to validate compose filedocker compose up -d and verify containers startdocker compose execCommit with a clear message describing what was changed.
{
"salientSummary": "Replaced webSearch.ts with SearXNG primary + Brave fallback. Installed cheerio for HTML parsing. Tests pass: 8 test cases covering SearXNG results, Brave fallback, interface preservation, date extraction, and error handling.",
"whatWasImplemented": "Rewrote webSearch.ts to use SearXNG JSON API (SEARXNG_URL env var) as primary search engine with Brave HTML scraping as fallback. Added cheerio dependency for Brave HTML parsing. Preserved SearchResult interface and function signature exactly. All 8 consumer files compile without changes.",
"whatWasLeftUndone": "",
"verification": {
"commandsRun": [
{ "command": "cd app/backend && bun test tests/externalTools.test.ts", "exitCode": 0, "observation": "12 tests pass, 0 fail" },
{ "command": "cd app/backend && bun test", "exitCode": 0, "observation": "All 45 tests pass across 17 files" },
{ "command": "bun -e \"import { webSearch } from './src/tools/external/webSearch'; webSearch('test').then(r => console.log(r.length))\"", "exitCode": 0, "observation": "Returns 5 results with valid URLs and snippets" }
],
"interactiveChecks": []
},
"tests": {
"added": [
{
"file": "app/backend/tests/externalTools.test.ts",
"cases": [
{ "name": "SearXNG returns results with correct shape", "verifies": "VAL-SEARCH-001" },
{ "name": "respects numResults parameter", "verifies": "VAL-SEARCH-002" },
{ "name": "falls back to Brave when SearXNG unreachable", "verifies": "VAL-SEARCH-004" },
{ "name": "throws when both engines fail", "verifies": "VAL-SEARCH-008" }
]
}
]
},
"discoveredIssues": []
}