chore(workspace-server): #1735 remove unused Awareness namespace surface #1737

Merged
hongming merged 3 commits from chore/issue-1735-remove-awareness-backend into main 2026-05-24 04:13:22 +00:00

3 Commits

Author SHA1 Message Date
hongming d7f61f97c8 review(env): #1735 drop AWARENESS_URL from .env.example
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
CI / Canvas Deploy Reminder (pull_request) Blocked by required conditions
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 8s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 17s
CI / Python Lint & Test (pull_request) Successful in 14s
CI / Detect changes (pull_request) Successful in 30s
E2E API Smoke Test / detect-changes (pull_request) Successful in 18s
Check migration collisions / Migration version collision check (pull_request) Successful in 51s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Successful in 14s
E2E Chat / detect-changes (pull_request) Successful in 23s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 30s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Successful in 1m53s
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Has been skipped
Handlers Postgres Integration / detect-changes (pull_request) Successful in 26s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Successful in 3m16s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 30s
Harness Replays / detect-changes (pull_request) Successful in 33s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 11s
E2E Staging External Runtime / E2E Staging External Runtime (pull_request) Successful in 5m27s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m35s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 33s
qa-review / approved (pull_request) Failing after 26s
security-review / approved (pull_request) Failing after 25s
gate-check-v3 / gate-check (pull_request) Successful in 8s
sop-checklist / review-refire (pull_request) Has been skipped
sop-checklist / na-declarations (pull_request) N/A: qa-review, security-review
sop-checklist / all-items-acked (pull_request) Successful in 7s
sop-tier-check / tier-check (pull_request) Successful in 8s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 5s
CI / Canvas (Next.js) (pull_request) Successful in 5s
E2E Chat / E2E Chat (pull_request) Successful in 14s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 15s
Harness Replays / Harness Replays (pull_request) Successful in 5s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m33s
CI / Platform (Go) (pull_request) Successful in 5m9s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m7s
CI / all-required (pull_request) All 5 required sub-jobs verified success in action_run_job table; umbrella timed out on commit-status propagation race (not a real failure). Compensating status posted under CTO-bypass 2026-05-24.
audit-force-merge / audit (pull_request) Successful in 13s
#1737 review finding (agent-reviewer 2026-05-23 against fe59d8d).
The backend removal dropped the env injection in
internal/provisioner/provisioner.go and the workspaces.awareness_namespace
column, but .env.example still documented AWARENESS_URL as "injected
into workspace containers along with a deterministic
AWARENESS_NAMESPACE derived from workspace ID" — false post-#1737.
Operators copying .env.example would set the var, see no effect, and
file false-bug reports.

Already addressed in this PR's history:
- docs/api-reference.md row + docs/api-protocol/platform-api.md line
  patched in commit 013c8cfe (same PR).
- Broader narrative docs sweep in #1758 (separate PR).

Refs: #1735, #1737 review finding.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 19:26:58 -07:00
hongming 013c8cfe58 review(docs): #1735 patch API spec lines describing awareness_namespace
ci-arm64-advisory / fast-checks (pull_request) Waiting to run
Lint shellcheck (arm64 pilot) / shellcheck-arm64 (pilot) (pull_request) Successful in 7s
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 6s
CI / Detect changes (pull_request) Successful in 10s
Check migration collisions / Migration version collision check (pull_request) Successful in 17s
CI / Python Lint & Test (pull_request) Successful in 3s
E2E API Smoke Test / detect-changes (pull_request) Successful in 6s
E2E Chat / detect-changes (pull_request) Successful in 7s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (local) (pull_request) Successful in 55s
E2E Peer Visibility (literal MCP list_peers) / E2E Peer Visibility (pull_request) Has been skipped
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 8s
E2E Staging SaaS (full lifecycle) / E2E Staging SaaS (pull_request) Has been skipped
Handlers Postgres Integration / detect-changes (pull_request) Successful in 5s
Harness Replays / detect-changes (pull_request) Successful in 6s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 4s
Lint no tenant GITEA or GITHUB token write / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 4s
E2E Staging SaaS (full lifecycle) / pr-validate (pull_request) Successful in 27s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 7s
qa-review / approved (pull_request) Failing after 3s
security-review / approved (pull_request) Failing after 3s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 56s
E2E Staging External Runtime / E2E Staging External Runtime (pull_request) Successful in 5m3s
gate-check-v3 / gate-check (pull_request) Failing after 4s
sop-checklist / na-declarations (pull_request) N/A: (none)
sop-checklist / all-items-acked (pull_request) Successful in 6s
sop-checklist / review-refire (pull_request) Has been skipped
sop-tier-check / tier-check (pull_request) Successful in 7s
CI / Canvas (Next.js) (pull_request) Successful in 6s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 5s
E2E Chat / E2E Chat (pull_request) Successful in 6s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 5s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 1m37s
Harness Replays / Harness Replays (pull_request) Successful in 5s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 2m9s
CI / Platform (Go) (pull_request) Successful in 5m10s
CI / all-required (pull_request) Successful in 38m28s
CI / Canvas Deploy Reminder (pull_request) Has been skipped
#1737 deletes the awareness_namespace column from `workspaces` and the
provisioner env injection that backed it. Two API-spec lines still
describe the field as if it were live, which would mislead any
external integrator reading the docs against a post-#1737 backend:

- docs/api-reference.md:106 listed `awareness_namespace` as a column
  on the `workspaces` row.
- docs/api-protocol/platform-api.md:93 claimed workspace creation
  "assigns an awareness_namespace on the workspace row" and the
  namespace is "later injected into the provisioned runtime".

Both are factually wrong post-#1737. Patched.

The broader docs sweep (~30 more references across
`docs/architecture/memory.md`, `docs/agent-runtime/*`, READMEs,
superpowers plans, etc.) is tracked in #1753 as a docs-only
follow-up — those are narrative / handbook copy, not contract.

Refs: #1735 (RFC), #1737 (the backend removal PR this rebases on),
#1753 (docs sweep follow-up), review-finding C3 (API doc contradiction).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 16:57:14 -07:00
hongming d20147300b chore(workspace-server): #1735 remove unused Awareness namespace surface
Drop the entire `Awareness namespace` memory-routing plumbing. The
feature was wired through migrations, models, the provisioner, and
several handlers but was never enabled in any environment — the
2026-05-23 sweep against the Railway controlplane (project
molecule-platform, prod env 59227671-…, staging env 639539ec-…) found
zero `AWARENESS_*` env vars set, and the operator-host bootstrap files
(`/etc/molecule-bootstrap/all-credentials.env`, `secrets.env`,
`agent-secrets.env`) likewise had no awareness entries. The provisioner
already only injected the env vars when both URL and namespace were
non-empty (so workspace containers also never received them).

Scope:
- Drop `workspaces.awareness_namespace` column via new forward migration
  `20260523130000_drop_workspaces_awareness_namespace.up.sql` (mirrors
  the recent `drop_runtime_image_pins` shape; paired down migration
  restores migration 010 verbatim).
- Drop `Workspace.AwarenessNamespace` from the model.
- Drop `WorkspaceConfig.AwarenessURL` + `AwarenessNamespace` and the
  conditional env injection in `internal/provisioner/provisioner.go`.
- Drop `workspaceAwarenessNamespace` + `loadAwarenessNamespace`, rename
  the one-line helper to `workspaceMemoryNamespace` (still produces the
  canonical `workspace:<id>` string matching the v2 namespace resolver
  at `internal/memory/namespace/resolver.go:186`).
- `seedInitialMemories` drops its `awarenessNamespace` parameter and
  computes the namespace inline — the parameter was always
  `workspace:<workspaceID>` at every call site, so the value is a pure
  function of the workspace id.
- Update three INSERT call sites (`workspace.go`, `org_import.go`) and
  the org-import root-memory seed in `org.go`.
- Trim `awareness_namespace` from the create-handler response payload.
- Remove ~22 awareness-specific test assertions and SQL-mock arg
  placeholders across `handlers_test.go`, `handlers_additional_test.go`,
  `workspace_test.go`, `workspace_provision_test.go`,
  `workspace_compute_test.go`, `workspace_budget_test.go`,
  `workspace_create_name_integration_test.go`, and
  `provisioner_test.go`.

The `agent_memories.namespace` column (added by migration 017) is
unaffected — seedInitialMemories continues to write `workspace:<id>`
into it, just computed inline now.

Canvas-side cleanup (the `<iframe>` block in `MemoryTab.tsx` reading
`NEXT_PUBLIC_AWARENESS_URL`) is deliberately deferred — it overlaps
with the rewrite landing in #1734 and goes in after that to avoid the
merge conflict.

Verification:
- `go vet ./...` clean.
- `go test -short -count=1 ./...` green (~30 packages).
- Migration round-trip verified on a throwaway `postgres:16-alpine`
  container: up drops the column, down restores it to the same
  `text` type as migration 010.

Refs: #1735 (this issue), #1733 (memory SSOT consolidation), #1734
(canvas Memory tab bug).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-23 16:55:10 -07:00