learning_ai_common_plat/services/platform-service/src
saravanakumardb1 b2ce22d81c feat(platform-service): direct tracker -> fleet module wiring (§10 round-trip)
In-process tracker<->fleet bridge — no shell hop. Closes the §10 "direct
tracker->module calls" box.

- tracker-bridge.ts (new):
  * ingestItemAsJob(productId, itemId, opts?) — reads the Item via the items
    repository (foreign/unknown → NotFoundError), maps title/description → bodyMd
    (verbatim) + labels (engine-class:/profile:/priority:/cap:) → manifest hints,
    sets trackerItemId + a stable idempotency-key `tracker-<itemId>`, and submits
    through coordinator.submitJob — so re-ingest dedupes and the job is scheduled by
    the §7 router via the unchanged claim path.
  * echoJobToItem(productId, jobId, log?) — mirrors stage → Item status
    (queued/assigned/building/review/testing → in_progress; shipped → done;
    failed/dead_letter → wont_fix) + a metrics-ONLY comment (attempts/duration/
    tokens/cost — never the prompt body/secrets). Idempotent via the job's
    `trackerEchoedStatus`; best-effort + non-fatal (items-write failure →
    { echoed: null, error }, never thrown into the job lifecycle). productId-scoped.
- Auto-echo wired into the PATCH + lease/release transitions, GATED by
  FLEET_TRACKER_ECHO (default OFF → behavior byte-for-byte unchanged); never blocks
  or fails the transition.
- Routes (additive): POST /fleet/tracker/ingest, POST /fleet/tracker/echo
  (auth + getRequestProductId, productId-scoped).
- types.ts: optional FleetJobDoc.trackerEchoedStatus (reuses the existing
  trackerItemId field; no parallel schema) + Ingest/Echo request schemas.
- repository.ts: setTrackerEchoedStatus (no rev bump — never interferes with the
  fenced claim CAS).

Reuses the items + comments contracts directly (no HTTP). Does not touch
claimNextJob or the scheduler. productId on every doc; no any/console.log.
2026-05-30 01:32:12 -07:00
..
lib feat(platform-service): fleet factory enrollment + scoped rotatable tokens (§12) 2026-05-30 00:05:52 -07:00
migrations refactor(platform-service): migrate webhooks/routes and migrations/runner from cosmos.js to datastore 2026-03-02 02:02:47 -08:00
modules feat(platform-service): direct tracker -> fleet module wiring (§10 round-trip) 2026-05-30 01:32:12 -07:00
nodemailer.d.ts feat(platform-service): add smtp email delivery and postal setup 2026-03-14 05:52:28 +00:00
server.test.ts feat(runtime): add platform runtime projection api 2026-04-04 01:14:37 -07:00
server.ts feat(platform-service): fleet REST routes + module registration (P2 foundation) 2026-05-29 20:20:46 -07:00