Publish an inspectable contract for durable agent-activity history and pagination. - Define the route wire shape, cursor semantics, retention, and SSE recovery behavior. - Add PostgreSQL and dashboard coverage for documented pagination and truncation guarantees. - Link architecture and diagnostics guidance to the canonical contract and validate its prerequisite lineage. Files changed: .changeset/fn-8864-agent-activity-events.md | 2 +- AGENTS.md | 1 + docs/agent-activity-contract.md | 94 ++++++++++++++++++++++ docs/architecture.md | 2 +- docs/diagnostics.md | 2 +- .../agent-activity-cursor-contract.pg.test.ts | 90 +++++++++++++++++++++ .../src/__tests__/agent-activity-route.test.ts | 10 +++ .../src/__tests__/sse-agent-activity.test.ts | 12 ++- scripts/check-fn-8864-ancestry.sh | 35 ++++++++ 9 files changed, 244 insertions(+), 4 deletions(-) Fusion-Task-Id: FN-8915 Fusion-Task-Lineage: da3f8c96-3b58-4e6d-a413-c51bdd643f26 Co-authored-by: Fusion (runfusion.ai) <noreply@runfusion.ai>
36 lines
1.3 KiB
Bash
Executable File
36 lines
1.3 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
set -euo pipefail
|
|
|
|
# FNXC:AgentActivityStream 2026-08-09-22:35:
|
|
# FN-8915 and dependent FN-8866 must fail closed until the durable activity stream is on their
|
|
# base. This gate proves the landed ancestry and required implementation surfaces before callers
|
|
# derive or consume the inspectable API contract.
|
|
|
|
required_commit="6bd178bdcf"
|
|
|
|
if ! git merge-base --is-ancestor "$required_commit" HEAD; then
|
|
echo "FN-8864 ($required_commit) is not on HEAD. Rebase onto origin/main before continuing." >&2
|
|
exit 1
|
|
fi
|
|
|
|
if [[ "$(git grep -l "AgentActivityEvent\|agent_activity_events" -- packages | wc -l | tr -d ' ')" == "0" ]]; then
|
|
echo "FN-8864 activity stream symbols are absent from packages/. Rebase onto origin/main." >&2
|
|
exit 1
|
|
fi
|
|
|
|
for required_path in \
|
|
packages/core/src/task-store/async/async-agent-activity.ts \
|
|
packages/core/src/postgres/migrations/0049_fn_8864_agent_activity_events.sql; do
|
|
if [[ ! -f "$required_path" ]]; then
|
|
echo "Required FN-8864 file is missing: $required_path" >&2
|
|
exit 1
|
|
fi
|
|
done
|
|
|
|
if ! grep -q "agent-activity" packages/dashboard/src/routes/register-setup-activity-routes.ts; then
|
|
echo "The FN-8864 agent-activity route is absent. Rebase onto origin/main." >&2
|
|
exit 1
|
|
fi
|
|
|
|
git log -1 --format='%h %s' "$required_commit"
|