Skip to content

API/MM-Cron setup (25 Oct)

1. Three streams, and who owns them

Stream What Owner now Owner after API-2
MM-Cron AMFI and AMC collectors and parsers, write path through the API current API/MM-Cron agent (design, issues), harness (adapters, tests), Sonnet (adapter framework) unchanged
API (production) api.moneymarche.com: security, NAV data quality, catalogue and MF routes, releases current agent (Lane P) current agent
stgapi (staging) stgapi.moneymarche.com: data load, route parity, staging deploys, MR clean-up current agent, lightly older agent, revived (Lane S)

2. Goal: the mutual-fund MM-Cron scripts complete for AMFI and all AMCs by the end of sprint 3 (28 Nov), at the latest one sprint later

Scope (from the data-source register S1–S12 and the MF data map):

Source Data Scripts
AMFI NAV (daily and history), scheme master, AUM, TER, performance, factsheet index collectors exist in part: finish logging, API write path, tests
51 AMCs Monthly factsheet (fund details: TER, size, inception, benchmark, managers) and monthly portfolio disclosure (holdings) one adapter per AMC behind a common framework

Plan: - Sprint 2 (1–14 Nov): - (1) Sonnet builds the adapter framework (critical path): common output schema, adapter interface, sample-file fixtures, acceptance tests, a registry of AMCs with source URLs, and logging. - (2) The API agent writes the AMFI completion LLD and the adapter work items: one row per AMC, grouped by file-format family (many AMCs share CAMS/KFintech layouts). - (3) The harness builds adapters for the top 15 AMCs by AUM, each a cx 1–2 issue with a public sample file and expected output (ctx public, so free models are allowed). - (4) API write routes for fund details and holdings are specified (keys, log-only first). - Sprint 3 (15–28 Nov): the remaining 36 adapters through the harness; AMFI scripts complete; everything writes through the API on staging, then production with Atul's approval. - Measured: adapters merged out of 51, AMFI scripts done out of 6, daily run success, data checked against AMFI totals.

3. Project instructions for the current API/MM-Cron ChatGPT project (paste into Instructions)

You are the API/MM-Cron agent for Money Marche: design, preflight and delivery for three streams: MM-Cron, API (production, Lane P) and stgapi (staging, Lane S, until a second agent takes it).
Rules: https://github.com/moneymarche-dev/MMDEP/blob/main/docs/agents/mmdep-agent-rules.md (§18 flows, §19 repository-only communication, §20 risk, §21 write what you say, §22 decisions register).
Who does what: https://github.com/moneymarche-dev/MMDEP/blob/main/docs/agents/allocation.md
Atul types only PROCEED. Never ask him technical questions: decide, mark ASSUMED, add a proposed row to the decisions register, continue. Business questions only, as for-atul/api-mmcron/<date>-<slug>.md in MMDEP (front matter: type decide/question, choices, blocking). Keep working on anything that doesn't depend on the answer.

CONTEXT PACK (read first on every PROCEED; create on the first one if missing, in both moneymarche/api and moneymarche/mm-crons):
AGENTS.md (rules and lanes, under 200 lines), docs/knowledge/CURRENT.md (systems, branches, hosts, open risks), docs/sprint/ACTIVE.md (sprint stories, queue link, owners). Update CURRENT.md and ACTIVE.md at the end of every PROCEED.

ON EVERY PROCEED, without waiting between steps:
1. Read the context pack, your queues (MMDEP docs/prompts/api-lane-p/S2/QUEUE.md and api-lane-s/S2/QUEUE.md), new rows for API/MM-Cron in MMDEP docs/relay/answers.md, and the harness results on MMDEP control branch harness/LATEST.md.
2. DESIGN AND PREFLIGHT: take the first queue step not done. For any change of more than one file, write or update an LLD in the repo (docs/design/<name>.md) with sections Context, Decision, Evaluation (V/S/C/D/L), Test plan, Risk, and a "Work items" table (one row per change: title, risk, cx, paths, tests, owner).
3. ALLOCATE every work item by the allocation rules:
   - cx 1-2, low risk, paths and tests known: a GitLab issue labelled for:code with a routing block (mode: scheduled, state: ready, model: gemini-flash-lite, ctx public or internal, scope.paths, tests). The local harness takes it.
   - cx 3+, or GitLab operations, or production preparation: you do it.
   - critical framework or a harness failure after escalation: route it to Sonnet (model: sonnet) with an MMDEP issue linking the GitLab issue.
   - high-risk design (security, data integrity, contracts): route it to Claude for review (MMDEP issue labelled agent:claude) before building.
4. REVIEW harness MRs in your repos: merge low risk on green CI with your self-check; send defects back as issue comments with state: ready.
5. Write runs/<step>.md (MMDEP docs/relay/api-lane-p/ or api-lane-s/) and continue with the next step until blocked or the session ends.
Reply in at most 8 lines: steps done, issues created for the harness (count), MRs merged, what's routed to Sonnet or Claude, the next step.

NEVER: production changes without Atul's approval; secrets or client data in issues, prompts or code; mm_data writes from staging; force-push protected branches.

4. Setup steps (Atul, about 10 minutes, then one PROCEED)

  1. Open the current API/MM-Cron ChatGPT project, then Instructions. Replace the text with the block in §3.
  2. Check that GitLab is connected with write access to moneymarche/api and moneymarche/mm-crons (same login as now).
  3. Send this first PROCEED: PROCEED: setup day. Create the context pack in api and mm-crons, then write the MM-Cron completion LLD (AMFI + all AMCs, setup doc §2) with its work-items table, and create the first 10 harness issues from it. Then continue your Lane P queue.
  4. After that, daily PROCEED only.
  5. When this works for 2–3 PROCEEDs, revive the older agent for stgapi (API-2). It takes Lane S off this agent.

5. What MMDEP does for this project

  • Sonnet: the adapter framework, the NAV de-duplication implementation after Claude's review, and the staging loader script.
  • Sonnet runs in Claude's cloud sessions, which can't reach gitlab.com today (tested 25 Oct).
  • Until Atul allows gitlab.com and adds a project token as an environment secret (SON-SCOPE, optional), Sonnet builds in MMDEP as an open work package (public data only, ADR-0009).
  • This agent, or the laptop harness, then moves the result into mm-crons in one MR.
  • Harness: add mm-crons as a GitLab source (Sonnet, one config line, once this agent names the base branch in CURRENT.md).
  • Claude: reviews the high-risk designs routed with agent:claude (write-route enforcement, NAV de-dup, adapter schema).