Files
MosaicIQ/agent.md
francy51 56b30dc276 Remove crabrl dependency and fix MSFT DEI fiscal period extraction
Remove crabrl dependency completely:
- Remove crabrl from Cargo.toml dependencies
- Remove crabrl Parser usage from facts.rs and xbrl.rs
- Remove latestXbrlParsed field from SourceStatus across TypeScript and Rust

Improve DEI fiscal period extraction:
- Add fallback logic for missing DEI facts in filings
- Add helper functions to extract fiscal year from period end dates
- Add helper functions to infer fiscal period from filing dates
- Update test fixtures to include proper DEI facts
- Make extraction more robust by using context period information

This fixes the "No eligible annual filings were found for MSFT" error
by making the DEI extraction more tolerant of incomplete metadata.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-12 14:23:22 -04:00

1.7 KiB

Agent Standards

This repository should favor durable backend code over fast patches. The baseline is:

Core rules

  • For the TypeScript/Vite/Tauri frontend toolchain, use bun as the package manager and script runner. Treat bun.lock as the source of truth.
  • Keep Tauri commands thin. Input validation, orchestration, and state changes belong in backend services, not in command handlers.
  • Do not leave dead code or disconnected module trees in the crate. If Rust cannot compile it, it is not part of the backend.
  • Prefer explicit types and narrow module boundaries over convenience abstractions that hide behavior.
  • Avoid shortcuts such as unwrap, expect, silent fallbacks, or placeholder logic in production paths.
  • Every backend behavior change should preserve cargo check and add or update tests when logic changes.

Rust patterns

  • Use conventional Rust module layout: mod.rs or flat sibling modules, not nested filename patterns that Cargo will ignore.
  • Return typed errors from backend services and convert them at the Tauri boundary only when required by the command interface.
  • Keep shared mutable state behind a narrow API. Do not let command handlers reach directly into ad hoc maps or storage.
  • Add doc comments to public types and functions. Add inline comments only when explaining why a constraint exists.
  • Prefer small, composable functions over commented blocks of procedural logic.

Review bar

  • No partially wired backend folders.
  • No mock or template code left in the active backend path.
  • No new public API without documentation.
  • No new stateful logic without at least focused unit coverage.
  • No structural change without verifying the crate still compiles.