116 Commits

Author SHA1 Message Date
fef0a8a71e fix(bundle): bind deployment metadata to the selected release 2026-10-23 17:14:44 +03:00
885fe6b649 feat(bundle): verify archive identities before image import 2026-10-23 16:45:51 +03:00
c7cd4023db docs(release): v1.0.0-rc3 interim release notes
Built with ./build.sh bundle v1.0.0-rc3 on 61a0e74e: clean PostgreSQL smoke passed, full backend
16694/0/0 on Python 3.11 (delivered package set) and 3.13, image pip freeze equals constraints-release.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-20 22:11:45 +03:00
0c850886e9 feat(translate): transfer the owner translate module from WIP 233e3936
The owner saved the translate refactor in WIP commit 233e3936
("chore(wip): save owner work in progress (2026-10-14)", parent 30907e66) and asked
for it to be moved onto master (7190786b) as its own change, reviewed on three axes
and merged only after the full verification gate.

Transferred verbatim with `git checkout 233e3936 -- <paths>` (no edits beyond the
fixes listed below, which are recorded in the transfer report):

backend/src/plugins/translate/** (61 files: module split of the LLM service and the
  executor, batch classification/insert rows, executor delegates/dispatch/parallel,
  llm prompting/records/recovery, scheduler execution, sql literals, sqllab
  execution, target schema catalog, token constants, record outcomes/filter
  forwarding, preview/prompt/sql/orchestrator modules, dictionary modules)
backend/src/models/translate.py + translate_identity.py, translate_job_runs.py,
  translate_dictionary_preview.py, translate_metrics_languages.py (same 15 tables and
  columns, split by domain behind a re-export facade; no migration needed)
backend/src/schemas/translate.py + translate_corrections.py, translate_dictionaries.py,
  translate_jobs.py, translate_preview.py, translate_runs.py
backend/src/api/routes/translate/** (dictionary entries split out)
backend/tests/plugins/translate/** (5 new tests incl. import-boundary and terminal-state)
frontend/src/lib/components/translate/** (new Config* sections, CorrectionDictionaryPopup,
  TranslationRunTerminalStatus, runOutcome helper, tests)
frontend/src/lib/api/translate/**, frontend/src/routes/translate/** (list, history,
  dictionaries, job wizard and detail), translation stores and models, i18n translate.json
frontend/e2e translation specs + fixtures/helpers, vitest.translation.config.js,
  playwright.translation-fixture.config.js
docs/tasks/2026-10-02-translation-*.md (7 plan/audit documents)

Fixes found while transferring (each has its own reasoning in the commit body below):
* tests/test_orchestrator_direct_db.py: the WIP replaced the silent direct_db ->
  Superset fallback with a typed failure; the stale test asserted the old fallback and
  is now pinned to the refusal (plus an end-to-end result assertion).
* docs/tasks/2026-10-02-translation-semantics-audit.md: the owner home path was
  replaced with `$REPO_ROOT` so no personal path enters git.

Deliberately NOT transferred (not translate): settings refactor, dashboard-testing,
research scripts, docker/full-flow, .kilo, tools/, other docs.
2026-10-20 20:23:50 +03:00
04f0764107 docs(specs): index archived plans and handoffs 2026-10-13 09:17:01 +03:00
6cf77cf162 chore(security): use Gitleaks pre-commit hook 2026-10-13 09:16:17 +03:00
ea03465f3e docs(testing): record parallel test follow-up status 2026-10-12 23:49:12 +03:00
d6ac8e4d8b docs(testing): record worker isolation proof 2026-10-12 23:21:00 +03:00
bc070d9473 docs(evidence): replace retired local references with archival index 2026-10-11 20:35:03 +03:00
2bd0396711 docs(specs): bring the untracked owner decisions and the no-fallback rule into the branch
The scope documents this work has to follow lived only as untracked files in the
main worktree, so the branch could not read the inventory it is required to
implement against - including
specs/050-mcp-interface/plans/2026-10-06-dashboard-testing-no-fallback-audit.md
(NF-1..NF-9), which AGENTS.md names as the tracking document for the
G-DASHBOARD-STRICT-EVIDENCE gate.

Copied byte for byte, sha256 verified per file (33 files, 0 mismatches):
- specs/050-mcp-interface/plans/2026-10-04-*, 2026-10-05-*, 2026-10-06-*.md
  (19 files);
- docs/matrix/traceability/* (14 files);
- AGENTS.md, whose no-fallback section and gate reference the branch lacked
  entirely (branch file was a strict subset: sha256 4782b7d6934ed7f2 both sides
  after the copy).

Nothing in the main worktree was modified and master was not touched. The
2026-10-07 plans were already tracked in the branch and identical, except
2026-10-07-stage1-current.md, which differs because this session has been
recording status in it.
2026-10-09 22:12:27 +03:00
596d6cc84c docs: update maintenance effort estimate 2026-09-29 14:27:58 +03:00
e7bac04e98 feat(dashboard-testing): add reference URL baseline workflow and analyst UX
Discover dashboard filters, datasets and metrics from a parsed reference URL; capture and review baseline candidates with source provenance. Improve scenario DAG and run result views, add isolated browser coverage, and align contracts and ADRs.
2026-09-25 10:36:37 +03:00
8522a2ee3c feat(scenario): complete dashboard testing UX flow 2026-09-15 10:12:17 +03:00
b4148cfe5f fix(automation): scheduled runs execute as schedule-owner principal; MCP upsert signature parity — live scheduled happy path proven (046 T018 CLOSED) 2026-09-11 20:22:47 +03:00
578a6110e7 fix(scenario): T045 review hardening — RUN_PROD REST gate, fail-marked typed errors, marker-bound adoption, unique idempotency, path guard 2026-09-11 19:05:20 +03:00
6dde7e15c3 feat(scenario): 050 T045 — gated MCP publish_baseline_catalog + 037 publication worker (CAS, receipts, reconcile), REST parity 2026-09-11 18:13:09 +03:00
f37a46e366 docs(reports): add ss-prod agentic E2E gap analysis and task notes
Add 2026-09-08 production gap/spec-coverage/refresh-plan and dashboard
scenario E2E plan/report, axiom-mcp feedback, and 2026-09-11 data-team
maintenance dev-test run notes.
2026-09-11 17:27:50 +03:00
de5e098a1b fix(scenario): review hardening — run.sh key reuse, resolver-canonical publisher envelope, strict pin asserts, honest T045/T046 statuses 2026-09-11 15:09:16 +03:00
7d3fb8a770 feat(scenario): live baseline pin via published Gitea catalog — publisher POST/PUT contract, run.sh key-wipe fix, T045/T046 closed 2026-09-11 14:07:20 +03:00
1411c03f9b fix(scenario): orthogonal review hardening — binding fingerprint guard, strict image digest, typed publisher errors, T029m human-loop closure 2026-09-11 10:10:01 +03:00
d04927bda7 feat(scenario): T029m live MCP replay — binding identity fixes, Gitea catalog publisher, 050 statuses 2026-09-11 08:40:37 +03:00
d2444f404b docs(specs): session-2 handoff + evidence-based 044/050 task statuses and session-state update 2026-09-10 20:49:50 +03:00
bf8abff753 docs(specs): live canary v2 trace + restore operation_id in browser evidence details 2026-09-10 20:14:49 +03:00
fe11a636f1 docs(scenario): live provider canary trace (T7/T8 passed) + two production defects closed 2026-09-10 18:27:46 +03:00
83727aa7f9 feat(scenario): complete offline agentic runtime chain 2026-09-10 14:14:40 +03:00
9c1a1e093c feat(mcp): Phase 2d field-run remediation — ADR-0024 agent-run surface, derived capabilities, disposition clarity
Source: live external MCP run against ss-prod Sales Dashboard (docs/2026-09-07-sales-prod-mcp-run.md) proved the initial-bootstrap chain externally unreachable: register_draft_pack requires a principal-owned AgentRun but no MCP operation created one after the chat decommission; the vertical E2E masked the gap with a raw-ORM prerequisite seed.

T029i: MCP create_agent_run/get_agent_run (mcp_server/tools_agent_run.py) over Services.AgentRuns.Service.Create — REST-parity EXECUTE/READ permissions, human-only, server-pinned UIContext, idempotency-key replay; catalog 2.1.0->2.2.0; MCPX-FR-027 external-reachability invariant pinned; initial-scenario E2E converted to the fully external chain (zero non-MCP seeding); strict-xfail pin flipped as designed, unmarked and hardened (E2E-EXT-001 CLOSED).

T029k: ScenarioGraph.CapabilityAuthority — truthful capability facts derived from the authoritative DashboardQueryModel (mutation-context capabilities never derived), derived-wins merge over caller declarations, single choke point wired into MCP inspect_scenario / inspect_dashboard_context and REST api_compile_scenario; CAP-001 classification-fix test on the sales-shape fixture (B02-B04/T01-T03 automated, C04-C06 unsupported, unsafe-mutation cases legitimately human).

T029l: disposition vocabulary clarity — RU/EN labels name the persisted outcome (confirm->passed), confirm restyled bg-destructive->bg-primary, decide_checkpoint description carries the immutable outcome table; lifecycle mapping and API vocabulary unchanged (DISP-001 CLOSED).

Decision memory: ADR-0024 (IMPLEMENTED, 4 rejected alternatives incl. no-AgentRun boundary and implicit auto-create) + README registry; 050 MCPX-FR-027/028/029 + release-gate rows + Clarifications session 2026-09-07; 038/044/045 field-run amendments -> IMPLEMENTED; WORKSTATE checkpoints (plan round + execution round).

Pre-existing HEAD regressions surfaced by the first full-suite rerun since 4d5ef6be/58c5ae39 and fixed: (1) stale SC-007 resource pin — canonical identifier is the post-redirect /mcp/ (code + twin pin aligned since the batches; test_mcp_client_flow_http pin updated with rationale); (2) app-lifespan tests re-entered the run-once StreamableHTTPSessionManager module singleton — autouse fresh-transport-app fixture (production lifespan runs once per process; singleton stays correct there).

Gates: full backend suite 11357 passed / 243 skipped / 1 xpassed / 0 failed (first green full run since the batches); MCP+catalog slice 70 passed; capability slice 67 passed; frontend vitest 3507 passed (206 files), lint 0 errors (364 baseline warnings), build OK; ruff/compileall clean; anchors balanced; scoped git diff --check clean. INV_7 watch: tools_scenario.py 508 LOC and routes scenario.py 442 LOC flagged for the next decomposition pass (new code lives in new modules 155/236 LOC).

OPEN: T029m / E2E-EXT-002 — live-stand replay of the sales scenario through the full external chain. Not included (foreign uncommitted workstream): translate/migration integration tests, _job_routes.py, .kilo/agent-manager.json, specs-036-050-20260907-111314.md.
2026-09-07 16:52:38 +03:00
58c5ae39cb feat(scenario): server-owned handle pipeline T029d–h + MCP bootstrap/automation + UI launch/approval
Backend (Phase 2c, closes ADR-0023):
- T029b/c: 9 automation MCP tools (REST-parity RBAC, scheduler registration, idempotency), migration 0018; fresh-DB MCP E2E.
- Guard BOOTSTRAP_REVISION_NOT_RUNNABLE in derive_runner_plan (provenance-only revisions never queue a vacuous zero-step PASS); demoted to defense-in-depth after materialization landed.
- T029d: CompiledScenarioHandle/ValidationResultHandle/DraftPackHandle (immutable, owner-bound, content-addressed canonical-bytes store), migrations 0019/0021; minting at REST compile/validate/resolve/draft-pack boundaries; single consumption under SELECT...FOR UPDATE + populate_existing, proven on PostgreSQL (Testcontainers).
- T029e: handle-first create_scenario/create_initial materialize canonical graph_snapshot (+ server-owned action_registry identity) in-transaction; OutboxEvent + RevisionMaterialization (0020) with idempotent worker wired into the scheduler poll loop (30s tick).
- T029f: MCP register_draft_pack write tool; bootstrap accepts only stored handle ids (transitional compile:{run}:{digest} removed); legacy REST POST /scenarios/{id}/revisions retired -> 410; catalog 2.0.0 (pinned-major ritual); ActionRegistry 038.2.0 — generate_report reclassified non-mutating (local draft write), register_artifact/row_edit/bulk_edit stay mutating.
- T029h (hybrid C+X1): inspect_dashboard_context MCP tool (live DashboardQueryModel resolver); context_authority evaluation — server recomputes client-context fingerprint (claimed values ignored), sentinel fingerprints never verify, unreachable env fails open to unverified, live-env mismatches reject typed with zero rows; marker persists on DraftPackHandle, materializes into graph_snapshot; PROD start refuses explicit non-verified (CONTEXT_AUTHORITY_REQUIRED_FOR_PROD); validator recursively rejects query_context/SQL smuggling in dashboard_context; catalog 2.1.0. 043 editor path provably inherits the marker.

Frontend:
- D2: scenario detail route scenarios/[id] — first production host of RunConfigurationPanel (typed 044 launch + Idempotency-Key + redirect to run monitor); ROUTES.scenarioDetail SSOT; registry index links to detail (launch stays off the index).
- D4: ApprovalDecisionPanel + RunMonitorModel.decideApproval — PROD gates decidable from the web UI (run-detail aside on pending_approval).
- Pre-existing suite repairs: oauth-consent raw goto -> ROUTES.login(); InvestigationModels stale dispose signature; settings mcp_oauth_* bind:value undefined crash (backend defaults 15/30/90).
- i18n: approval_* + scenario_detail_* keys in en+ru.

Specs/docs (amendments 2026-09-06/07):
- 038: PackCompiler.Generate contract corrected (pure manifest); ServerOwnedPipeline handle-persistence amendment; verification-program reconciliation (implemented vs PROPOSED IR entities).
- 042: synchronous graph materialization + outbox scope; CreateInitial amendments; RevisionChain @REJECTED for raw client graph_snapshot.
- 050: stage-table implementation-status note, handle-rules status, T029–T029h evidence; WORKSTATE checkpoints; ADR-0023 -> IMPLEMENTED.

Gates: backend full regression 3360 passed (+ PostgreSQL integration green), alembic single head 0021; frontend vitest 3506 passed, lint 0 errors, build OK.
2026-09-07 11:26:34 +03:00
4d5ef6bed0 feat: dashboard-testing UX remediation + admin MCP governance + i18n sweep
- UX audit Fix 1-5: actionable MCP HandoffSurface (endpoint/discovery/onboarding), reachable
  approval loop (sidebar section + waiting-for-me badge), honest MCP entry labels, ROUTES SSOT
  for dashboard-testing/load-testing (+ link-integrity coverage)
- scenario registry hub (/dashboard-testing/scenarios) built on ScenarioRegistryModel
- admin MCP governance: read-only GET /api/admin/mcp/catalog (catalog x roles + DCR clients) +
  /admin/mcp page/model/api + ROUTES.admin.mcp + sidebar entry
- full i18n sweep of dashboard-testing routes and scenario-* component trees (ru/en)
- accumulated workspace: MCP OAuth/DCR, automation idempotency migration, docker/nginx, specs
2026-09-05 20:16:26 +03:00
65121cac6b feat(logging): self-diagnosing EXPLORE + shared/ absorption + belief analytics (ADR-0021/0022)
T0: absorb shared/ into backend — cot_logger→src/core, CotJsonFormatter→src/core/cot_formatter.py, _llm_http/_llm_health/ssl→src/core/utils; imports rewritten (26 prod + tests, patch targets); run.sh/backend.Dockerfile/requirements/.axiom source_dirs/semantic_health/AGENTS/INSTALL cleaned; ADR-0022 supersedes ADR-0015; fixed latent CI defects (ss_tools ImportError, record.message in logger tests, same-name test-module collision).

ADR-0021 wire enrichment (additive): contract_id/claim/error_code/loc fields; _contract_id ContextVar + resolve_contract_id (explicit > belief_scope > declared-src mirror, derived src never mirrors); EXPLORE auto-loc via single frame walk; facade error auto-fill; 2KB payload cap with payload_truncated/payload_bytes markers; migrated 85 error="CODE" sites to error_code= (12 files); pilot editor/load.py; superset preview payload-bomb inlined bodies removed.

Analytics SSOT src/core/log_stats.py (bond transition matrix, orphan-EXPLORE ratio, REFLECT pairing, intent families, coverage, insufficient-sample flag); pretty_cot.py --stats/--digest/--trajectory/--story over one engine; log_gap_service three-tier ground-truth triangulation (FAILED w/o EXPLORE etc.) + GET /api/reports/log-stats|task-log-gaps (polling-suppressed); scripts/cot_audit.py CLI; enriched fields persisted into task_logs.payload for tier queries.

Frontend: ReportsAnalyticsModel + AnalyticsStatsPanel (Logs tab) + TaskGapPanel and per-row T1/T2/T3 gap badges (Tasks tab); cot-logger.ts ADR-0021 opts; i18n en/ru. Scheduler console spam fixed: apscheduler logger demoted to WARNING via LoggingConfig.scheduler_log_level. .axiom belief patterns -> $OBJ.* (alias undercount). molecular-cot-logging skill updated (fields, decision rules, tie-break, CLI) and synced.

Reviewed orthogonally: F1 cot_span contract pollution, F2 cap boundary accounting, F3 digest over-dedup, F4 trace-state bound, F5 tier metadata — fixed with regression tests. Validation: backend 11287 passed + ruff + compileall; frontend 3446 passed + lint + build; CLI smoke on live app.log.
2026-09-04 20:56:41 +03:00
ddbfe00fc5 fix(semantics): round 3 — zero parse warnings via relation/canonical fixes, MCP parser patches
- All schema parse warnings NOW ZERO (unclosed, def_deprecated, invalid_enum,
  unknown_tag, invalid_predicate, invalid_tier: 0).
- Redirect 42 dead @RELATION targets to existing contracts (Core.Database.*→
  DatabaseModule, User→Models.Auth.User, create_task→Core.Manager.TaskManager,
  AuthMiddleware→Dependencies.AppDependencies, AuthRepository→Core.Repository.*,
  _handle_deploy_helpers→Api.RepoLifecycleRoutes, etc.).
- Config: add NAMESPACE/SEE (Doxygen-native), TYPE empty-enum (suppress JSDoc
  @type false positives), remove *.html exclude (prototype contracts now
  indexable), extend LAYER enum.
- Plan doc: record round-3 results (2066→1171, -43%).

MCP parser fixes (axiom-mcp sibling repo):
- comments.rs: detect block-comment terminator BEFORE stripping leading '*'
  (bare '*/' close line no longer stays open → 20 Svelte __unclosed__ cleared).
- parser.rs line 249: only comment-normalized lines carry GRACE anchors
  (payload.unwrap_or('') instead of .unwrap_or(raw_line)) → string-literal
  '#region' misreads + prose [DEF:] false positives cleared.
2026-09-03 09:09:21 +03:00
731aaaa8df feat(mcp): 050 unified MCP interface — parity tools, durable gates, authoring E2E, assistant decommission
044 provider runtime completion (pre-staged workstream): capacity/operator
stores, provider ops/protocol/reconciler/dispatch revalidation, exploration
sandbox runtime, alembic 0014-0016, live canary evidence (browser provider
6/6 against the live stand).

050 Phases 0-2: RBAC FastMCP server with a 45-tool explicit catalog,
OAuth/DCR transport guards with bounded bodies, per-call provenance
(McpToolInvocationRecord), durable ActionApprovalGate + CAS decide +
leased/fenced poller, authoring workspace ops, bounded-response discipline,
hidden-vs-gated matrices.

Parity domains (T012-T014): gated git/deploy/migration/backup/llm tools with
reviewed dispatch adapters in explicit poll chains; Superset reads/writes with
a dedicated plugin:superset_sql risk class (terminal PROD denial via the
canonical execution-policy criterion, hardened danger-SQL guard covering
INTO/CALL/SET/REFRESH/file primitives/multi-statement); baseline 037 tools
over the shared REST-surface services.

Evidence (T016/T023/T028): REST-vs-MCP field parity on shared 037 fixtures;
vertical E2E from tools/list through registry revision activation with real
scenario:EDIT RBAC; sandbox-to-revision promotion E2E with unsafe-payload and
caller-digest rejection; dispatcher soak (three poll cycles, exactly-once).

Orthogonal QA+security audit hardening: enforced response_limit fail-closed
envelope, poisoned-exploration fail-closed (EXPLORATION_TARGET_UNRESOLVED),
sha256 exploration evidence digests, actor-UUID task ownership, is_active
guard on baseline consume, 038 resolver description=None selector fix.

Phase 3/4 decommission: HandoffSurface behind the MCP_DECOMMISSION flag,
then unconditional removal — agent/ service tree, chat components/models/
stores/types, gradio proxies (vite + nginx), agent service in run.sh,
docker-compose profiles, build.sh bundles; /agent renders the handoff only.
Docs: AGENTS.md/INSTALL.md two-service rewrite; 036-047 drift amendments
marked done; WORKSTATE checkpoints with all evidence.

Suites: backend 11199 passed / 240 skipped / 1 xpassed; frontend 3454 passed
(197 files), lint 0 errors, build OK; browser E2E login+handoff 6/6 twice on
the isolated compose stack (no 7860); ruff/compileall clean.

Misc: gitignore hardening (tmp/, tool model cache); E2E selector repairs
(nav strict-mode, invalid-credentials passthrough detail).
2026-09-03 07:37:14 +03:00
341d54399a fix(semantics): repair GRACE-Poly anchors, relations, and metadata
Repair broken/unclosed semantic-protocol markup across the codebase:

- INV_3 region pairing: restore 87 bare '# #endregion' (6 test_structure_*
  files) and 321 bare '// #endregion' (13 frontend test files) with their
  matching IDs; hand-fix 26 Python + 12 frontend + 2 E2E files with
  mismatched/missing/premature/duplicate closes; fully migrate
  test_orthogonal_fixes.py from single- to double-hash anchors.
  Workspace-wide stack-pair scan now passes 6569 code files with 0 problems.
- Relations: normalize legacy predicates USES/CONTAINS/BELONGS_TO to
  canonical DEPENDS_ON/BINDS_TO (28 edits).
- Metadata: normalize @LAYER and [TYPE] enum values to the canonical
  vocabulary (App->Application, lib->Infra, Service/Route/Checklist/
  Declaration/Decorator/Functions -> Module/Function/Block, etc.).
- Config: extend tags.LAYER.enum; fix tools.py prose '#region' phantom that
  broke anchor nesting.
- Remove dead scratch scripts backend/_convert_defs.py, _batch_convert_defs.py.

Index refresh: contract count 9576 -> 10821; schema_unclosed_anchor
1179 -> 729 (remaining 729 are markdown legacy [DEF:]/brace anchors, a
separate migration phase).
2026-09-01 12:24:42 +03:00
0415a2ed7d chore: accumulate uncommitted workspace changes 2026-08-26 17:03:22 +03:00
4b9619e229 refactor(deploy): standardize enterprise environment file 2026-08-25 15:30:10 +03:00
5bc1b62bd0 refactor: unify initialization and reset migration baseline 2026-08-25 11:42:31 +03:00
585a00c537 semantic-curation: fix anchors, metadata, and relations across backend + specs
- Replace legacy @PURPOSE with @BRIEF across 241 files
- Add missing [C:N] complexity tiers to function contracts in core modules
- Fix tombstone contracts: add @STATUS DEPRECATED to 5 deprecated anchors
- Resolve 7 unresolved @RELATION edges in executor.py (DictionaryManager, TranslationPreview, etc.)
- Fix flat hierarchical IDs in 4 test files (22 test functions)
- Fix invalid tags/relations in logger.py (@ADR, @CONSEQUENCES, DISABLED_BY)
- Rebuild semantic index: 9,576 contracts, 4,742 edges, 0 parse warnings
2026-08-20 11:45:15 +03:00
81ba94684f feat: sed-мутации датасетов, правки миграции и фиксы
- Dataset viewer: sed-замена (find→replace) по всем/выбранным/текущим датасетам
  с обязательным визуальным предпросмотром и целями (sql/metrics/yaml); сохранение
  и выбор именованных правил (sedRules store + SedRuleEditor).
- Migration: literal-замена в dataset YAML при переносе; рескан ID чартов/датасетов
  перед миграцией + метрика средней длительности синка (GET /migration/sync-stats);
  логическая группировка опций (маппинги БД, сервер изменений, rescan) под галочками.
- Fix: дашборды хаба скрывались дефолтным профиль-фильтром show_only_slug_dashboards=true
  (теперь false); мастер миграции не грузил дашборды предзаполненного источника;
  потеря терминального task_status из-за утечки pending-корутин в /ws/logs (панель
  результата не появлялась); горизонтальный скролл в MappingTable; чистая per-env
  ошибка в mapping coverage.
- Backend: record_sync_duration + alembic-миграция sync-duration; literal_replace модуль.
2026-08-19 10:29:28 +03:00
e3de06832a feat(orchestration): long-lived workers across all roles + KV-cache economics
- contracts: Self.Worker.Verify/Curate now carry the long-lived invariant
  and "refined in place" brief (matching Implement)
- skill §9: cycle says "read freely" + "spawn long-lived worker, refine"
- skill §11 (new): token & KV-cache economics — long-lived send_message
  keeps the prefix byte-identical (warm cache), fork invalidates it,
  spawn starts cold; merge envelopes; keep surface lean
2026-08-18 16:15:23 +03:00
b232c347fd feat(orchestration): make workers long-lived, not disposable
Workers are continuable long-lived children: spawn once, refine in place
via send_message as the feature evolves; a worker's own session persists
and compacts independently. Re-spawn only when the context is poisoned.

- skill §3: delegation tree rewritten — "refine, don't re-spawn"
- skill §5: "refine, don't re-spawn" coordination rule
- skill §7: stalled worker → send_message (keep context), fresh spawn
  only for poisoned context
- contracts: Self.Worker.Implement is "long-lived, refined in place";
  add long-lived invariant
2026-08-18 16:11:07 +03:00
8a2a12964c fix(orchestration): architect reads freely; delegate execution, not reading
Drop the "never read raw files" rule — it was a false economy. The
architect's context is large and auto-compacting, so reading is cheap and
necessary for decomposition and verification. The real boundary is
EXECUTION (edits/builds/tests) stays with workers, not READING.

- skill §1/§6/§10: "read freely" replaces "never read raw files";
  prefer read_outline/search_contracts to locate, read/grep/glob to understand
- @RATIONALE reframed: reading is cheap; only DECISIONS must not live
  solely in context (they go to files)
- contract: invariant becomes "reads freely for decisions, delegates execution"
2026-08-18 15:52:06 +03:00
ca1761f490 fix(orchestration): harden thin-context protocol against observed drift
Session-log review found the orchestrator diverging from its own design.
Encode every divergence as a rule + invariant:

- no polling: get_goal/list_agents are state tools, not completion checks
  (settlement/report are the signals) — was 101 get_goal + 98 list_agents
- no raw reads: structure via read_outline/search_contracts; file CONTENT
  is delegated (was 77 read vs 1 read_outline)
- <RESULT> enforcement: a worker result with no envelope is blocked
  (was 4/19 envelopes)
- closed role taxonomy: only Implement/Verify/Curate (was ad-hoc
  "code reviewer"/"auditor"/"adversarial")
- fork semantics: fork inherits MY context, not a stalled worker's;
  no "takeover" via fork
- interrupt only to redirect; let workers finish (was 7 interrupts)
- decision memory written by me to files (was zero file writes)
- skill hygiene: load self-orchestration once; never load worker skills
- cross-workspace: point Axiom at the target or delegate all reading
2026-08-18 14:51:50 +03:00
f1ee96fda8 fix(orchestration): stop workers from inheriting the orchestrator role
Child subagents join the parent's preset composition, so by default they
inherited the orchestrator persona AND the delegation tools — and drifted
into orchestrating instead of working (observed: a "worker" called
list_agents/get_goal/send_message and spawned its own grandchildren).

Fixes:
- preset: subagent/subagent_fork now carry a role-agnostic worker `persona`,
  `toolFilter.deny` for all delegation/coordination tools, and `maxDepth: 1`
  (children cannot spawn grandchildren) — hard enforcement at the boundary
- skill: every worker prompt opens with a mandatory role-reset block
- contracts: Self.Worker.Implement/Verify gain a LEAF invariant (no subagents,
  no delegation tools)
2026-08-18 14:41:37 +03:00
977f3d6d75 chore: checkpoint working tree onto master
Carried over from 042-dashboard-scenario-registry:
- dashboard/migration backend changes + tests (dataset_key_sync)
- specs updates; drop generated doxygen artifacts
- research notes, integration artifacts, session log
2026-08-18 12:20:42 +03:00
604b3dc706 feat(orchestration): add implementer and verifier workers
Complete the role graph with the two remaining leaf workers.

Skills:
- self-implementation: implement inside @PRE/@POST/@INVARIANT guardrails,
  verifiable edit loop, decision-memory preservation, <RESULT> envelope
- self-verification: orthogonal falsifiable verification, hardcoded
  fixtures, @TEST_INVARIANT traceability, anti-tautology

Presets (staged under docs/design/*-preset; installed to ~/.dsh/.agent-presets):
- implementer: native wire, leaf, bash for the verifier
- verifier: native wire, leaf, bash for pytest/vitest

Contracts (self-orchestration-contracts.md, now 13 contracts):
- Self.Implement.{EditLoop,DecisionMemory}
- Self.Verify.{Traceability,AntiTautology}
- worker edges: Implement/Verify DISPATCHES -> their sub-contracts
2026-08-18 09:17:48 +03:00
e6c77cc3da feat(orchestration): self-orchestration flow — orchestrator + curator
Add the thin-context orchestration protocol as loadable skills,
agent presets, and verifiable GRACE-Poly contracts.

Skills:
- self-orchestration: architect protocol (memory hierarchy, delegation
  decision tree, <RESULT> envelope, park-don't-poll, anti-loop)
- semantic-curation: curator protocol (audit → one-file repair → verify →
  rebuild → health report; anti-corruption invariants)

Presets (staged under docs/design/*-preset; installed to ~/.dsh/.agent-presets):
- orchestrator: native wire, tuned compaction (0.75/0.20), full toolset
- curator: native wire, leaf (no delegation), bash reserved for git rollback

Contracts (docs/design/self-orchestration-contracts.md, indexed + audited):
- Self.Orchestrator, Self.Worker.{Implement,Verify,Curate}
- Self.Curation.{Loop,HealthReport,AntiCorruption}
- Self.Contract.{ResultEnvelope,DecisionTree}
2026-08-18 09:07:14 +03:00
3421484347 chore: synchronize remaining workspace updates 2026-08-10 07:29:08 +03:00
9de74baa08 feat: dashboard testing suite — scenario UI, load testing, dataset lineage
- 039-dashboard-scenario-ui: agent workspace (WorkspaceModel, scenario
  views, parameters/baselines, artifact preview, HITL save/approval,
  evidence/VLM review, pipeline verification views) + contextVersion=2
  scenario intent + prototype.
- 040-dashboard-load-testing: capacity/matrix/profile, runner pool,
  timing, circuit breaker, PROD gate, cache/bounded/consistency,
  comparison/schedule, API + frontend + prototype.
- 041-dataset-lineage-blast-radius: usage index, severity/schema-diff,
  propagation, deprecation, fanout, API + frontend + prototype (R9
  labels/metrics/recreate).
- 036/037 amendments: dataset_updated trigger + fanout_plan_id, lineage
  deprecation gate, 040 read-model traceability.
- Includes pre-existing 042-rls-management-workspace and
  043-idm-account-integration work.
2026-08-05 18:15:30 +07:00
4d282b43e2 perf(maintenance): skip sqlparse on oversized virtual-dataset SQL
sqlparse raises SQLParseError above MAX_GROUPING_TOKENS=10000 tokens
(~25KB of typical SQL). The try/except fallback already handled it, but paid
~1s per oversized SQL for a parse doomed to fail. Add _SQLPARSE_SKIP_THRESHOLD
(30k chars) to bypass sqlparse for oversized text (~15x faster, 1.2s->0.08s for
a 212KB SQL) while keeping literal filtering for SQL under the threshold.

Tests: oversized-SQL skip-threshold behavior.
2026-08-03 23:52:03 +07:00
02a97bfc9c fix(maintenance): survive sqlparse token cap on huge virtual dataset SQL
Discovery of virtual datasets now works, but a runtime blocker remained: any
virtual dataset whose SQL exceeds sqlparse's MAX_GROUPING_TOKENS (10000 tokens)
raised SQLParseError 'Maximum number of tokens exceeded (10000)' from
extract_tables_from_sql_span, which is called unguarded in the scan loop — one
oversized virtual dataset aborted the whole maintenance preview/start.

- extract_tables_from_sql_span now wraps sqlparse.parse + token walk in
  try/except and falls back to regex-only extraction (keeping all schema.table
  matches) instead of raising, so huge SQL no longer fails the scan.
- Tier-1 virtual filter uses value "" (not None) so the sql is_not_null filter
  passes Superset's rison schema instead of always falling back to a full scan.

Tests: huge-SQL fallback (extractor) and huge-virtual-dataset scan resilience
(scanner). ADR-0020 updated with Decision 3.
2026-08-03 23:48:01 +07:00
52e909a2da fix(maintenance): discover virtual (SQL) datasets in dashboard scanner
Virtual (SQL) datasets were never matched, so maintenance discovery returned
0 affected dashboards. Two defects fixed:

- find_affected_dashboards filtered by is_sqllab_view, which is NOT a
  filterable column in Superset's dataset list API (absent from search_columns),
  so the query was rejected. Now discover virtual datasets via the filterable
  sql column: primary server-side 'sql is_not_null' filter with a client-side
  non-empty-sql scan as fallback (best-effort vs pagination cap), dedupe by id.

- AsyncAPIClient.request never called raise_for_status(), so rejected filters
  (HTTP 400) were returned as bodies without a 'result' key and surfaced as
  'Found 0 datasets', dead-coding the filtered->full-scan fallback. request()
  now raises on non-2xx via the existing error mapper.

Tests cover both virtual-scan tiers, all fallback paths, the raise behavior,
and an end-to-end match with the real sql_table_extractor on production SQL.
Documented in ADR-0020.
2026-08-03 22:21:00 +07:00