Skip to content

fix(presence): preserve omitted heartbeat context - #135

Merged
andrei-hasna merged 1 commit into
mainfrom
fix/64bd104d-heartbeat-preserve
Aug 9, 2026
Merged

fix(presence): preserve omitted heartbeat context#135
andrei-hasna merged 1 commit into
mainfrom
fix/64bd104d-heartbeat-preserve

Conversation

@andrei-hasna

@andrei-hasna andrei-hasna commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Summary

  • preserve stored project focus and metadata when heartbeat fields are omitted
  • retain explicit project clear and metadata replacement semantics across HTTP/Postgres and local SQLite
  • send an exact partial heartbeat body from ApiStore so omission survives transport

Validation

  • bun test src/server/api.test.ts src/lib/presence.test.ts src/lib/store/api-store.test.ts — 130 pass, 0 fail
  • bun test — 1790 pass, 0 fail
  • bun run typecheck
  • bun run build
  • staged diff check and exact-commit gitleaks scan

Task: CON2-00048
Todo: 64bd104d-a414-44cd-a48a-ae6c649d3c02


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #135 @ 10973a1 — lens: correctness+security+gates, reviewer unresolved-account013 (1 of 1)

Reviewed the full diff against origin/main at 7683229 and surrounding source for all six changed files: src/lib/presence.ts, src/lib/presence.test.ts, src/lib/store/api-store.ts, src/lib/store/api-store.test.ts, src/server/api.ts, and src/server/api.test.ts. I also traced ConversationsStore callers, the heartbeat CLI/MCP call sites, request parsing, and the SQLite/PostgreSQL agent_presence schemas and unique-agent indexes.

Commands and gates:

  • bun install — exit 0; setup only, 166 packages installed.
  • bun run typecheck — exit 0; PASS; the gate emits no pass/fail count.
  • bun run test — exit 0; PASS; 1790 pass, 0 fail, 6240 expect() calls across 119 files.

Blocking P0/P1 findings: none. The authenticated heartbeat path now preserves omitted project and metadata fields on existing rows while explicit null/empty values still replace them, and the local SQLite and remote HTTP/PostgreSQL paths are consistent for the supported store calls.

Non-blocking follow-ups: none.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] NO_GO — #135 @ 10973a1 — lens: correctness+security+gates, reviewer unresolved-account013 (1 of 1)

Focused pre-merge gate correction: the required base-movement check failed after the initial GO was posted. refs/pull/135/merge^1 resolves to 7414fcb, while freshly fetched origin/main resolves to 7683229. The head-only typecheck and tests therefore do not validate the exact tree that would land.

Blocking P1 finding: required compatibility gate is stale. Rebase the PR branch onto current main, rerun bun run typecheck and bun run test, and bind a focused replacement verdict to the new head. The intervening base change is confined to SDK generation and attachment files, but the repository's full declared gates still need to run on the combined candidate.

Non-blocking follow-ups: none.

Keep stored project focus and metadata when heartbeat fields are omitted, while preserving explicit clear and replacement behavior across HTTP and SQLite.

Task: CON2-00048
Task: 64bd104d-a414-44cd-a48a-ae6c649d3c02

Agent: cossus
@andrei-hasna
andrei-hasna force-pushed the fix/64bd104d-heartbeat-preserve branch from 10973a1 to 6e9b792 Compare August 9, 2026 19:01
@andrei-hasna

Copy link
Copy Markdown
Contributor Author

[REVIEW] GO — #135 @ 6e9b792 — lens: correctness+security+gates, reviewer unresolved-account013 (1 of 1)

Focused re-review of the named compatibility-gate defect and its direct regressions: the branch was rebased onto current main at 7683229, producing head 6e9b792. The six-file heartbeat diff is unchanged, and the combined candidate now includes the intervening SDK generation and attachment changes that the previous merge ref lacked.

Commands and gates on the rebased candidate:

  • bun run typecheck — exit 0; PASS; the gate emits no pass/fail count.
  • bun run test — exit 0; PASS; 1797 pass, 0 fail, 6270 expect() calls across 120 files.
  • gitleaks git --redact --log-opts='origin/main..HEAD' . — exit 0; PASS; 1 commit scanned, no leaks found.
  • Lease-protected PR-branch push — exit 0; remote head read back as 6e9b792.

Blocking P0/P1 findings: none. The prior base-staleness blocker is resolved.

Non-blocking follow-ups: none.

@andrei-hasna

Copy link
Copy Markdown
Contributor Author

Probe correction for the earlier base-staleness comment: that NO_GO was based on an invalid instrument and is withdrawn. Fetching main and refs/pull/135/merge together left FETCH_HEAD resolving to the main entry, so FETCH_HEAD^1 measured main's parent, not the PR merge ref.

The corrected explicit-ref probe returned:

  • CURRENT_BASE=7683229b19789e7ce2836c4cffcfc0c88cd915b9
  • TESTED_BASE=7683229b19789e7ce2836c4cffcfc0c88cd915b9
  • TESTED_HEAD=6e9b792c46556a3365bf3cf4d1e88ccde1d05eff
  • EXPLICIT_MERGE_REF_MATCH=PASS

The latest [REVIEW] GO remains the operative verdict. The rebased candidate was independently revalidated with typecheck exit 0 and 1797 tests passing, 0 failing.

@andrei-hasna
andrei-hasna merged commit e1db7d1 into main Aug 9, 2026
3 checks passed
@andrei-hasna
andrei-hasna deleted the fix/64bd104d-heartbeat-preserve branch August 9, 2026 19:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant