+
{/* تایملاین ریز مکالمات و لاگ اقدام ایجنتها */}
diff --git a/frontend/admin-panel/src/services/hermesApi.ts b/frontend/admin-panel/src/services/hermesApi.ts
index ee69c27d..0fb86d9a 100644
--- a/frontend/admin-panel/src/services/hermesApi.ts
+++ b/frontend/admin-panel/src/services/hermesApi.ts
@@ -9,7 +9,21 @@ export type TaskDepartment =
export type TaskPriority = 'CEO_EXPEDITE' | 'CRITICAL' | 'HIGH' | 'MEDIUM' | 'LOW';
-export type TaskStatus = 'TODO' | 'IN_PROGRESS' | 'DONE' | 'BLOCKED' | 'CANCELLED';
+export type TaskStatus = 'TODO' | 'IN_PROGRESS' | 'TEST' | 'DONE' | 'BLOCKED' | 'CANCELLED';
+
+export interface TaskEvidence {
+ id: string; artifactUri: string; sha256: string; executor: string;
+ tool: string; summary: string; result: string; createdAt?: string;
+}
+export interface TaskReview {
+ id: string; evidenceId: string; reviewer: string; passed: boolean; findings: string;
+ verification: { artifactUri?: string; sha256?: string; method?: string; result?: string };
+}
+export interface TaskEffect {
+ id: string; metric: string; availability: string; baseline?: number | null;
+ observed?: number | null; source: string; observedAt?: string;
+}
+export interface RelationMeta { total: number; returned: number; limit: number; truncated: boolean }
export interface TaskLogItem {
id: string;
@@ -39,6 +53,10 @@ export interface CorporateTaskItem {
createdAt: string;
updatedAt: string;
logs?: TaskLogItem[];
+ evidence?: TaskEvidence[];
+ reviews?: TaskReview[];
+ effects?: TaskEffect[];
+ relationsMeta?: Record;
}
export interface TaskFilterParams {
diff --git a/specs/corporate-acceptance-test-gates/plan.md b/specs/corporate-acceptance-test-gates/plan.md
new file mode 100644
index 00000000..b98e9fe1
--- /dev/null
+++ b/specs/corporate-acceptance-test-gates/plan.md
@@ -0,0 +1,7 @@
+# Plan
+
+Ownership: backend/src/wiki/wiki.service.spec.ts; backend/scripts/test-postgres.py; backend/package.json test scripts; this spec directory only. No corporate service/runtime or UI files.
+
+Graphify: queried scratch copy at /opt/data/cache/scratch/backend-acceptance-graph (4304 nodes). Original SHA256 6a73473cee9e207543fdeeb668bea544f766200a1b16b8a3a9ce18d4e42e51af; provenance not SHA-bound, navigation only. Direct source confirms WikiService reads relevance candidates (take 100), ranks then slices; shared metadata helper uses totalPages and compatibility lastPage. Existing publication URL guard mandates port 55447; SEO mandates port 55439; corporate mandates loopback corporate_test. Tests destructively clean fixtures, so only newly initialized clusters are eligible.
+
+Runner uses existing PostgreSQL binaries via PG_BIN or PATH, mkdtemp under TMPDIR, explicit loopback ports/private sockets, Prisma db push into newly created databases, child-only test URLs and guaranteed pg_ctl stop in finally. No daemon reuse. Default test runs serially to avoid shared fixture collisions. Direct Jest remains available for explicit targeted unit tests; the default npm test gate never silently skips missing PostgreSQL URLs.
diff --git a/specs/corporate-acceptance-test-gates/spec.md b/specs/corporate-acceptance-test-gates/spec.md
new file mode 100644
index 00000000..5e79835e
--- /dev/null
+++ b/specs/corporate-acceptance-test-gates/spec.md
@@ -0,0 +1,11 @@
+# Backend acceptance test gates
+
+Scope: wiki unit-test expectations and isolated PostgreSQL full-suite setup only. No service/runtime/UI edits, deployment, cron, production configuration or business-data writes.
+
+Acceptance:
+- Wiki tests distinguish bounded relevance candidate retrieval from final page slicing and verify filtered count metadata; non-search pagination remains database-driven.
+- Default backend test command provisions disposable loopback PostgreSQL and executes publication, SEO and corporate database integration suites instead of silently skipping missing URLs.
+- Missing PostgreSQL binaries or occupied dedicated ports fail explicitly. Existing runtime DATABASE_URL is never used for schema setup.
+- Preserve existing dirty/untracked work. Stage-principal tests are separate opt-in tests requiring Redis and /app artifacts; report their skips explicitly.
+
+Baseline: develop 69dd6922f6ce25e5b98471b14282b7834537431a. Initial dirty state: graphify-out/cache/last_query_stamp; untracked .specify/ and evidence/. RED full suite: 2 failed, 99 passed, 6 skipped; 1 failed/905 passed/25 skipped tests.
diff --git a/specs/corporate-acceptance-test-gates/tasks.md b/specs/corporate-acceptance-test-gates/tasks.md
new file mode 100644
index 00000000..7884d877
--- /dev/null
+++ b/specs/corporate-acceptance-test-gates/tasks.md
@@ -0,0 +1,20 @@
+# Tasks
+
+- [x] Inspect source, graph provenance, branch, dirty state and existing tests.
+- [x] Run baseline full suite RED and retain /opt/data/cache/scratch/backend-suite-red.log.
+- [x] Correct wiki expectations; add ranking/page-2 and non-search pagination checks.
+- [x] Implement disposable PostgreSQL runner and default test command; fail closed on setup failure.
+- [x] Run full backend GREEN, record commands/counts and explicit remaining skips; verify owned diff only.
+
+## Execution evidence
+
+Working directory for commands: `/opt/data/content-maintenance/engine/worktree-concurrency-tdd/backend`.
+- RED before edits: `npm test -- --runInBand` (then direct Jest script): 2 failed, 99 passed, 6 skipped suites; 1 failed, 905 passed, 25 skipped tests. `/opt/data/cache/scratch/backend-suite-red.log`.
+- GREEN: `PG_BIN=/opt/data/cache/scratch/seo-pg-bin/bin npm test`: exit 0, 105 passed and 2 skipped suites; 934 passed and 3 skipped tests, 62.56s. `/opt/data/cache/scratch/backend-suite-green.log`. All SEO, publication, corporate and API-key PostgreSQL suites executed. Remaining skips are two Stage-principal lifecycle suites (Redis and `/app` prerequisites), not missing database URLs.
+- `PG_BIN=/does-not-exist npm test`: expected exit 1, explicit missing-initdb failure. `/opt/data/cache/scratch/backend-pg-missing-bin.log`.
+- Bind 127.0.0.1:55439 in a Python socket then invoke runner: expected exit 1, address in use. No existing server reused or stopped.
+- `npm run build`: exit 0 (`tsc -b`). `git diff --check`: exit 0.
+- All three fresh PostgreSQL 16.2 clusters stopped after full suite and temporary cluster directory removed. No production connection or configuration accessed. Existing dirty graph stamp and untracked .specify/evidence preserved.
+
+Setup detail: publication's existing source URL allowlist contains a dedicated test-only credential. Runner reads and validates its literal loopback prefix to avoid duplicating it; first execution exposed that redacted tool display must not be treated as the credential itself. No change to publication or corporate test/service files was necessary. Docker unavailable; reused already-installed local PostgreSQL binaries, with no package installation.
+
diff --git a/specs/corporate-execution-observability/acceptance-matrix.md b/specs/corporate-execution-observability/acceptance-matrix.md
new file mode 100644
index 00000000..67cd1179
--- /dev/null
+++ b/specs/corporate-execution-observability/acceptance-matrix.md
@@ -0,0 +1,31 @@
+# Bounded acceptance-gap audit
+
+Baseline: develop 69dd6922f6ce25e5b98471b14282b7834537431a, official Stage run1352. Audit is bounded to existing specs, runtime scripts, corporate service/controller, UI/services and focused/full-suite evidence; not a claim of enterprise acceptance.
+
+| Criterion | Code/tests | Deployment/behavior | Verdict / next dependency |
+|---|---|---|---|
+| Real persisted source provenance | corporate research/source tables, validated HTTPS metadata, manual ingest stores fetched bytes and SHA256 | Baseline both Stage images independently read as 69dd6922, restart0; source inventory pilot exists, not autonomous business research | partial: discovery/synthesis and provider-backed intelligence missing |
+| Monthly research -> persisted roadmap/goals | service roadmap requires persisted research with sources; manual CLI manifest | Existing integration tests; no demonstrated automatic strategy synthesis | partial |
+| Daily NEW article plan separate from refresh | UI promises daily new; roadmap counts only; fanout creates source inventories | No dated article planning or article executor | missing |
+| Needs-based refresh/catalog/wiki/engineering/devops | dormant deterministic structural department audits and GET-only plan_day | Not clinical enrichment, code execution, or publication; plan is not persisted task fanout | partial |
+| Atomic claim/execution/evidence/independent QA | service lease fencing, idempotency, TEST, distinct review identity, exact hash verification | Existing real disposable DB tests and source-inventory pilot | partial: only manual bounded inventory/audits, no business action adapters |
+| Visible instruction/action/result/evidence/QA | Task detail shows description and event summaries only; evidence/reviews/effects omitted; TEST absent in frontend status type/filter | API detail includes these relations; UI cannot inspect exact receipts | **missing next slice**: read-only persisted execution dossier + TEST status |
+| PMO outcomes/report | persisted backend report snapshots, explicit truncation; manual GET-only plan | No integrated daily plan/report consumer or report UI | partial |
+| Market pagination/filter/search | pagination/category UI + backend; no search | Not authenticated/mobile accepted in this audit yet | partial |
+| Roadmap pagination/filter/search | pagination UI, month backend only; no search | Not authenticated/mobile accepted yet | partial |
+| Tasks pagination/filter/search | server pagination, normalized title/code, dept/status/priority | Missing TEST option; execution dossier absent | partial |
+| SEO under Hermes/mobile | existing tracking page and API, independent telemetry limits | Requires distinct authenticated mobile review, not proven by compile | partial |
+| No fake fallback | APIs reject unavailable collections; UI explicit errors; metrics unavailable != zero | Preserve; no demo business data added | code present, scoped verification required |
+| Test gates | baseline full Jest: 2 failures incl wiki expectation and absent isolated DB URLs | Repair full gate with fresh private PostgreSQL harness, no live DB reuse | partial until repaired run |
+| Public author attribution | credentialless genuine authors restored; marker denied all auth paths | Baseline API repair confirmed by parent; public attribution UI still unresolved | partial; inspect real byline/metadata, never invent credentials/clinical expertise |
+| Autonomous operation | runtime explicitly MANUAL_DORMANT, schedules false | Must remain cron-disconnected until whole acceptance | deliberately not enabled |
+
+## Slice selection
+First unblock truthful inspection of persisted execution: without exact tool/result/hash and independent QA visible, a higher-level planner would create more uninspectable tasks. Implement read-only dossier, real TEST status/filter, empty and bounded-history disclosures. No schema/business writes, new scheduler, approval modules, Hermes config/restarts, Production or main changes.
+
+## Remaining sequence
+1. Accept this dossier and corrected isolated DB gate on exact-SHA Stage.
+2. Research-backed dated daily-new article planning, separate needs-based refresh/catalog/wiki/engineering task lineage, API idempotent persistence (review schema separately if needed).
+3. Implement narrowly allowed action adapters with immutable instruction/action/result/evidence and independent QA; no model-output-is-DONE shortcuts.
+4. Persist PMO outcomes and downstream daily plan; add market/roadmap search/filter/report UI, finish authenticated mobile acceptance and real public author checks.
+5. Only after complete independent acceptance consider explicit activation of the currently dormant/manual runtime; no cron changes in this program slice.
diff --git a/specs/corporate-execution-observability/graph-provenance.json b/specs/corporate-execution-observability/graph-provenance.json
new file mode 100644
index 00000000..227d07e2
--- /dev/null
+++ b/specs/corporate-execution-observability/graph-provenance.json
@@ -0,0 +1,11 @@
+{
+ "baseSha": "69dd6922f6ce25e5b98471b14282b7834537431a",
+ "graphSha256": "6a73473cee9e207543fdeeb668bea544f766200a1b16b8a3a9ce18d4e42e51af",
+ "graphSourceBinding": "unknown; stale navigation only, verified direct source",
+ "queryCopy": "/opt/data/cache/scratch/corporate-gap-graph/graph.json",
+ "dirtyBefore": [
+ "graphify-out/cache/last_query_stamp",
+ ".specify/",
+ "evidence/"
+ ]
+}
\ No newline at end of file
diff --git a/specs/corporate-execution-observability/plan.md b/specs/corporate-execution-observability/plan.md
new file mode 100644
index 00000000..95904ca7
--- /dev/null
+++ b/specs/corporate-execution-observability/plan.md
@@ -0,0 +1,3 @@
+# Plan
+
+Baseline 69dd6922. Existing graph SHA binding unknown: SHA256 recorded in graph-provenance.json, query scratch copy finds stale unrelated Evidence/review nodes, used only navigation; direct corporate service/controller and UI sources verified. API already returns evidence/reviews/effects/relationsMeta. Add typed optional relation DTOs plus read-only TaskExecutionDossier component rendered inside existing fetched detail. Include TEST type/config. Own UI/API types/tests; backend test gate child owns disjoint paths. Use existing release workflow and gitea remote, never local bundle origin for push.
diff --git a/specs/corporate-execution-observability/spec.md b/specs/corporate-execution-observability/spec.md
new file mode 100644
index 00000000..b82f3808
--- /dev/null
+++ b/specs/corporate-execution-observability/spec.md
@@ -0,0 +1,3 @@
+# Persisted execution dossier
+
+Show existing authenticated task detail instruction, action type, assigned executor, exact evidence tool/result/URI/hash, independent QA verification and observed effects. TEST is a real selectable status. Read-only: no action buttons, claims or synthetic fallback. Empty evidence and missing metrics must not imply success. Expose relation truncation. Wrap long hashes/results on 390px; semantic labelled dialog with close button. Unit regression RED before UI edit; full admin tests/typecheck/build, backend full fresh PostgreSQL suite, storefront suite/build then exact-SHA Stage authenticated mobile acceptance. No schema, prod/main, cron/Hermes config or business-data SQL writes.
diff --git a/specs/corporate-execution-observability/tasks.md b/specs/corporate-execution-observability/tasks.md
new file mode 100644
index 00000000..21eaf3cb
--- /dev/null
+++ b/specs/corporate-execution-observability/tasks.md
@@ -0,0 +1,8 @@
+# Tasks
+
+- [x] Bounded acceptance audit, source/API boundary review, preserve baseline untracked artifacts.
+- [ ] Dossier and TEST regression RED.
+- [ ] Minimal typed read-only dossier GREEN; full suites/build.
+- [ ] Integrated source review, sole-owner develop push.
+- [ ] Exact CI terminal logs, both images/restarts, authenticated Stage/mobile dossier + public real author UI evidence.
+- [ ] Record remaining acceptance gaps without whole-program readiness claim.