Skip to content

title: Previous API agent's handover answers (18 Oct 2026) — distilled source: Atul pasted the previous agent's two answers into https://docs.google.com/document/d/1hJQ8-erK7McpKxuigcfBE7BcCTbpFVwGrV4Kzb8Wxhc/edit (questions: docs/agents/prompts/old-api-agent-questions.md) status: evidence from repository inspection by that agent; it ran no production queries


Previous API agent: what it knows

# Topic Answer (short) Next action for the API/MM-Cron agent
1 Swagger/OpenAPI None exists. Routes in src/routes.py (api-phase1-development); hand-written docs: route compatibility matrix, route/DB/producer/consumer matrix (MR !157, issue #39), Phase 1 functional spec; route-surface tests Generate OpenAPI from the Flask routes; reconcile with MR !157
2 Data dictionary None. Closest: docs/architecture/MF-DATA-MAP.md, architecture doc (MR !153), NAV writer inventory (MM-Cron MR !78). Tables named: mm_product, mm_category, mm_product_owner, mm_product_type, mm_product_fund_details, funds_nav, nifty_index, mm_nfo_list, tmp_funds_nav, mm_portfolio, mm_portfolio_items (+ holdings, sectors, home_page_category) Build the column dictionary from the live schema (read-only), catalogue tables first
3 Route inventory Matrix is not complete; params and response shapes spread across handlers, models, specs, tests Part of the OpenAPI work
4 Direct DB access API itself; MM-Cron NAV publisher (tmp_funds_nav → funds_nav), missing.py, clihandler.py, lambda/navdata, lambda/parsedata (SchemeData), lambda/portfolio, nifty_history_loader.py. WordPress plugins and webapp-sakai: not known. Source inventory, not proof of what runs Confirm active writers (cron/Lambda) with Ajay; complete the website/webapp column
5 NAV duplicates/gaps Key (scheme_code, nav_date). Classifier is last-row-wins; direct-DB path inserts only if the key is absent, so a wrong same-date value is never corrected. No production counts, no gap audit, no fix merged. API !164/!165 are SQL binding, !161 returns semantics, not fixes Read-only audit: duplicate keys and gaps per scheme and index; then a persistence contract (no constraints/upserts without approval)
6 AMC master, factsheets GET /product/owners, GET /product/owner/<code>, table mm_product_owner; writer and refresh job not known. AMFI factsheet index mentioned in MF-DATA-MAP as a discovery reference; AMC URLs live in lambda/portfolio/lib/config/amc/ (source-controlled, can go stale) Design DS-2/DS-3: resolve links from AMFI monthly; reconcile owners
7 Category flags Serializer returns the stored values (no forcing to 1). If the live API shows 1 everywhere, the database values themselves may be 1, or a different deployed version/cache is serving. Roll-up rule not implemented in the API; website rule not known Read-only comparison: live /category vs mm_category.status/show_in_menu/parent; find the website's menu code (MWMC/WPDev). This corrects our 13 Oct note that the database holds real values: unverified
8 stgapi Current state unknown. Two past incidents: host starved by WordPress/Apache (issue #30, not the API); missing mm_product_holdings table in staging (issue #29). Recovery steps listed; staging and production share mm_data (Ajay, 12 Oct) Health check with Ajay; prove write isolation before any staging write; smoke harness MR !159, population contract MR !158
9 Credentials API: API_KEY (env already), SUITECRM_CLIENT_ID/SECRET, SMTP_PASSWORD → MR !168. MM-Cron: API_KEY, NAV DB profile, SuiteCRM ID/secret/legacy user+password, SMTP → MRs !81, !83; inventories !62, !84. No rotation done Security fast lane: review !168/!81/!83, then rotation by a person
10 Open MRs No blanket supersession; suggested review order: security inventory (!84, !111, !62) → credential code (!168, !81, !83) → staging safety (!71, !73, !158, !159) → API correctness (!164, !165, !161) → NAV lineage (!78, !77, !74, !156, !157) → architecture/catalogue docs → old route/tests → CI (!170 on hold) Use this order
11 Other Release-C not staging-verified after resolver fix (!147); production runtime SHA unknown; NAV acquisition ≠ durable publication; keep identities separate (scheme_code vs product_id/ISIN/portfolio_id; NIFTY 50 ≠ NIFTYM150MOMNTM50); TEA gate for deployments Keep as constraints

Outdated instruction found: the previous agent still believed "GitLab CPU quota exhausted: do not run CI". Since 14 Oct, CI runs on the laptop runner (laptop,docker), so pipelines may run.