Skip to content

fix(backend): update core files for correct SMILE methodology#17

Open
jv-singh wants to merge 2 commits into
stagingfrom
fix/backend-smile-updates
Open

fix(backend): update core files for correct SMILE methodology#17
jv-singh wants to merge 2 commits into
stagingfrom
fix/backend-smile-updates

Conversation

@jv-singh
Copy link
Copy Markdown
Collaborator

@jv-singh jv-singh commented Jun 6, 2026

Summary

  • The previous codebase hardcoded a hallucinated 5-phase acronym (SENSE → MODEL → INTERVENE → LEARN →
    EVOLVE) that does not exist in the LPI data source. The real SMILE is Sustainable Methodology for Impact
    Lifecycle Enablement — 6 sequential phases sourced verbatim from data/smile-framework.json.

  • This PR replaces the 5-phase enum with the correct 6-phase enum, recomputes the scoring formula, rewrites
    the SMILE and scoring tests for the new phases, and fixes three documentation files that still contained
    literal "sense" strings — anyone copying the QA matrix or running the proxy-data script would have hit 422
    validation errors otherwise.

  • Phases (correct, in order):

  1. reality-emulation — establish the reality canvas
  2. concurrent-engineering — define the MVT, validate virtually
  3. collective-intelligence — sensors, ontologies, KPIs
  4. contextual-intelligence — real-time decisions, connected twin
  5. continuous-intelligence — AI prognostics, simulation
  6. perpetual-wisdom — share impact, circular strategies

The transition rule (forward one step allowed, backward any, skip forbidden, same-phase forbidden) is
unchanged — only the phases it operates on were wrong.

Score range: [0.80, 6.70] → [0.80, 7.00] (PERPETUAL_WISDOM = 6, the new max weight).

Closes the test failures in tests/test_smile.py and tests/test_scoring.py caused by phase-name mismatches.

Type

  • Fix (bug — wrong phase enum, wrong weights, wrong test expected values, stale doc literals)
  • Refactor (replaced 5-phase enum and PHASE_WEIGHTS with the correct 6-phase versions; added
    get_phase_key_question())
  • Docs / reports (3 doc files with stale "sense" literals corrected)

Checklist

  • make lint exits 0 (run locally before push)
  • make test exits 0 (run locally before push)
  • Tests added or updated for changed behaviour (tests/test_smile.py, tests/test_scoring.py,
    tests/test_smoke.py, tests/test_goal_crud.py, tests/conftest.py)
  • Daily report updated in reports/ (see note below — needs to be filled in before merge)
  • No .env secrets committed
  • PR targets staging (never main directly) → note: current branch is fix/backend-smile-updates, target
    staging

Tests passing

  • tests/test_smoke.py — test_imports, test_health, test_smile_phase_order (now asserts 6 phases)
  • tests/test_smile.py — TestPhaseOrder (5 tests), TestPhaseTransitions (15 tests), TestPhaseDescriptions
    (6 tests)
  • tests/test_scoring.py — TestPhaseWeightsConstant (13 tests), TestScoreGoalKnownValues (12 tests),
    TestScoreGoalWithUrgency (4 tests), TestScoreGoalProperties (5 tests), TestSortGoalsByScore (9 tests),
    TestScoreExplanation (5 tests) — 48 tests total, up from 46
  • tests/test_goal_crud.py — TestCreateGoal (4), TestReadGoal (4), TestUpdateGoal (4), TestDeleteGoal (1) —
    all phase literals now correct
  • tests/test_recommendations.py — unaffected (no phase string assertions, only docstring mentions)

Daily report reference

reports/2026-06-06.md (to be created — covers the SMILE 6-phase correction and the doc-only follow-up)

Files changed

LPI_SMILE_Written_Report.pdf

@jv-singh jv-singh self-assigned this Jun 6, 2026
@jv-singh
Copy link
Copy Markdown
Collaborator Author

jv-singh commented Jun 6, 2026

Screenshot 2026-06-06 080846

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant