{
  "version": "peaksat-app-workflow-2026-10-22.v1",
  "environment": "Authenticated production application HTTP integration with a dedicated synthetic QA identity and independently checked original fixtures. Not a browser session, generated-question approval audit, student study, or score-gain test.",
  "startedAt": "2026-10-23T03:13:44.753Z",
  "completedAt": "2026-10-23T03:16:29.688Z",
  "protocolSha256": "f3f3ac9a1c62f196f65c37807db3710c85d6ccb6b0e3c1bebd6473987a8396d0",
  "registeredAt": "2026-10-23T03:08:40.433506+00:00",
  "productionTrafficUnchangedDuringRun": true,
  "productionRevision": "peaksat-web-ctrcomp1021-33f1542287-7ed9-stage",
  "authenticationMethod": "New synthetic Firebase account, using the already-enabled email/password method and a real Firebase session cookie. Full-access entitlement was inserted only for this isolated QA identity; no Stripe checkout or payment occurred.",
  "bootstrapLimitations": [
    "Before app requests, the old QA custom-token signer was unavailable and signing with the alternate existing account was denied. Those failed bootstrap attempts remain in private evidence. Neither made an application or model request. No IAM role or authentication-provider configuration was changed."
  ],
  "model": {
    "appReportedIdentifier": "gemini-4-argon",
    "providerReturnedVersionExposed": false,
    "generationSettings": "Unchanged production application configuration; this endpoint does not expose provider settings or internal transient-error retry counts."
  },
  "requests": [
    {
      "label": "anonymous access gate",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:13:55.913Z",
      "expected": 401,
      "requestBody": {
        "mode": "hint",
        "message": "One hint, please.",
        "history": []
      },
      "completedAt": "2026-10-23T03:13:56.263Z",
      "status": 401,
      "expectedStatusPassed": true,
      "response": {
        "error": "Sign in to save your study work."
      }
    },
    {
      "label": "dedicated synthetic account authentication",
      "route": "/api/auth/me",
      "method": "GET",
      "startedAt": "2026-10-23T03:13:56.276Z",
      "expected": 200,
      "requestBody": null,
      "completedAt": "2026-10-23T03:13:57.083Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "authenticatedSyntheticOwnerVerified": true
      }
    },
    {
      "label": "signed-in account without entitlement",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:13:57.084Z",
      "expected": 403,
      "requestBody": {
        "mode": "hint",
        "message": "One hint, please.",
        "history": []
      },
      "completedAt": "2026-10-23T03:13:57.329Z",
      "status": 403,
      "expectedStatusPassed": true,
      "response": {
        "error": "A PeakSAT subscription is required for this feature.",
        "code": "billing/subscription-required"
      }
    },
    {
      "label": "distribution-linear: explanation before attempt",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:13:57.389Z",
      "expected": 409,
      "requestBody": {
        "mode": "explain",
        "message": "Explain the full solution.",
        "history": []
      },
      "completedAt": "2026-10-23T03:13:57.812Z",
      "status": 409,
      "expectedStatusPassed": true,
      "response": {
        "error": "Submit an answer before asking for a full explanation."
      }
    },
    {
      "label": "distribution-linear: hint",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:13:57.813Z",
      "expected": 200,
      "requestBody": {
        "mode": "hint",
        "message": "I am stuck before starting. Give me one small hint and a question to try. Do not reveal the value of x.",
        "history": []
      },
      "completedAt": "2026-10-23T03:14:08.576Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "answer": {
          "message": "**Hint:** A great first step to simplify this equation is to clear the parentheses on the left side using the distributive property.",
          "nextQuestion": "What expression do you get on the left side when you multiply 4 by both terms inside (x - 3)?",
          "suggestedAction": "Reply with the expanded left side of the equation to take the next step.",
          "model": "gemini-4-argon"
        }
      }
    },
    {
      "label": "distribution-linear: next step",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:14:08.577Z",
      "expected": 200,
      "requestBody": {
        "mode": "step",
        "message": "I distributed to get 4x - 12 = 2x + 10. What is the next small step? Please do not finish it for me.",
        "history": []
      },
      "completedAt": "2026-10-23T03:14:50.611Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "answer": {
          "message": "Great job distributing! Your equation **4x - 12 = 2x + 10** is spot on. The next small step is to gather all the **x** terms on one side of the equation by subtracting **2x** from both sides.",
          "nextQuestion": "What does the equation look like after you subtract 2x from both sides?",
          "suggestedAction": "Subtract 2x from both sides of the equation.",
          "model": "gemini-4-argon"
        }
      }
    },
    {
      "label": "distribution-linear: scripted wrong attempt",
      "route": "/api/study/generate/answer",
      "method": "POST",
      "startedAt": "2026-10-23T03:14:50.615Z",
      "expected": 200,
      "requestBody": {
        "sessionId": "f6736f6f-46a4-4c81-bf48-ac54638a56a2",
        "answer": "5",
        "elapsedSeconds": 30,
        "answerChanges": 0
      },
      "completedAt": "2026-10-23T03:14:51.051Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "isCorrect": false,
        "correctAnswer": "11",
        "explanation": "4x - 12 = 2x + 10, so 2x = 22 and x = 11. Substitution gives 32 = 32. At x = 5, the two sides are 8 and 20."
      }
    },
    {
      "label": "distribution-linear: explanation after attempt",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:14:51.051Z",
      "expected": 200,
      "requestBody": {
        "mode": "explain",
        "message": "I submitted 5. Explain exactly where that value fails, show a valid solution, and ask me to check it.",
        "selectedAnswer": "5",
        "history": []
      },
      "completedAt": "2026-10-23T03:15:13.670Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "answer": {
          "message": "**Why 5 Fails:** When we substitute **x = 5** into the original equation **4(x - 3) = 2x + 10**, the left side evaluates to **4(5 - 3) = 4(2) = 8**, while the right side evaluates to **2(5) + 10 = 10 + 10 = 20**. Because **8 ≠ 20**, **x = 5** does not satisfy the equation (this mistake commonly happens if the **-12** term is accidentally dropped, turning **2x - 12 = 10** into **2x = 10**). **Distractor Comparison:** The question data has an empty choices list because this is a free-response question, so there are no multiple-choice distractors to compare. **Shortest Valid Solution:** Starting from your distributed equation **4x - 12 = 2x + 10**, subtract **2x** from both sides to get **2x - 12 = 10**. Next, add **12** to both sides to get **2x = 22**. Finally, divide both sides by **2** to get **x = 11**.",
          "nextQuestion": "To check the solution, what number do you get on the left side and on the right side when you substitute x = 11 into 4(x - 3) = 2x + 10?",
          "suggestedAction": "Substitute x = 11 into both sides of the equation to verify the answer.",
          "model": "gemini-4-argon"
        }
      }
    },
    {
      "label": "distribution-linear: scripted fresh transfer answer",
      "route": "/api/study/generate/answer",
      "method": "POST",
      "startedAt": "2026-10-23T03:15:13.671Z",
      "expected": 200,
      "requestBody": {
        "sessionId": "11d52c36-5448-488c-abd1-b97b070192fc",
        "answer": "7",
        "elapsedSeconds": 30,
        "answerChanges": 0
      },
      "completedAt": "2026-10-23T03:15:14.143Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "isCorrect": true,
        "correctAnswer": "7",
        "explanation": "5x + 10 = 3x + 24, so 2x = 14 and x = 7. Substitution gives 45 = 45."
      }
    },
    {
      "label": "reverse-percentage: explanation before attempt",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:15:14.989Z",
      "expected": 409,
      "requestBody": {
        "mode": "explain",
        "message": "Explain the full solution.",
        "history": []
      },
      "completedAt": "2026-10-23T03:15:15.196Z",
      "status": 409,
      "expectedStatusPassed": true,
      "response": {
        "error": "Submit an answer before asking for a full explanation."
      }
    },
    {
      "label": "reverse-percentage: hint",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:15:15.199Z",
      "expected": 200,
      "requestBody": {
        "mode": "hint",
        "message": "I am unsure which number is the percentage base. Give one small hint and ask me to set up the relationship, without giving the original price.",
        "history": []
      },
      "completedAt": "2026-10-23T03:15:38.769Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "answer": {
          "message": "**Hint:** A discount is always calculated as a percentage of the **original price** (the starting value before the change), so $64 is the final result rather than the percentage base. **Diagnostic Question:** If $p$ represents the unknown original price and 20% of it is removed, what percentage of $p$ remains, and how can you write an equation setting that equal to $64?",
          "nextQuestion": "If $p$ represents the unknown original price and 20% of it is removed, what percentage of $p$ remains, and how can you write an equation setting that equal to $64?",
          "suggestedAction": "Write an equation relating the original price p to $64",
          "model": "gemini-4-argon"
        }
      }
    },
    {
      "label": "reverse-percentage: next step",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:15:38.770Z",
      "expected": 200,
      "requestBody": {
        "mode": "step",
        "message": "I wrote 0.8p = 64. What should I do next? Please give only the operation, not the final price.",
        "history": []
      },
      "completedAt": "2026-10-23T03:15:53.422Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "answer": {
          "message": "Spot on! Setting up $0.8p = 64$ is exactly right. To isolate $p$, your next step is to **divide both sides of the equation by $0.8$**.",
          "nextQuestion": "What value do you get for $p$ when you divide $64$ by $0.8$?",
          "suggestedAction": "Calculate 64 / 0.8",
          "model": "gemini-4-argon"
        }
      }
    },
    {
      "label": "reverse-percentage: scripted wrong attempt",
      "route": "/api/study/generate/answer",
      "method": "POST",
      "startedAt": "2026-10-23T03:15:53.423Z",
      "expected": 200,
      "requestBody": {
        "sessionId": "16738319-d7f8-4b10-abfc-202bdcb02f68",
        "answer": "76.8",
        "elapsedSeconds": 30,
        "answerChanges": 0
      },
      "completedAt": "2026-10-23T03:15:54.131Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "isCorrect": false,
        "correctAnswer": "80",
        "explanation": "The final price is 80% of the original: 0.8p = 64, so p = 80. Multiplying 80 by 0.8 returns 64. Increasing 64 by 20% instead gives 76.8 and uses the wrong base."
      }
    },
    {
      "label": "reverse-percentage: explanation after attempt",
      "route": "/api/study/tutor",
      "method": "POST",
      "startedAt": "2026-10-23T03:15:54.139Z",
      "expected": 200,
      "requestBody": {
        "mode": "explain",
        "message": "I submitted 76.8 by adding 20% to 64. Explain the mistaken base, solve correctly, and show a multiplication check.",
        "selectedAnswer": "76.8",
        "history": []
      },
      "completedAt": "2026-10-23T03:16:26.939Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "answer": {
          "message": "**Why 76.8 Fails (The Mistaken Base):** Calculating $64 \\times 1.20 = 76.8$ treats the final discounted price ($64) as the percentage base. However, the 20% discount was taken from the **original price** ($p$), which is larger than $64. Because 20% of the larger original price is greater than 20% of $64, adding 20% of $64 back on falls short. *(Note: The question data contains no multiple-choice options because this is a free-response question, though 76.8 is the most common trap answer.)* **Shortest Valid Solution:** A 20% discount leaves 80% ($0.8$) of the original price $p$, giving the equation $0.8p = 64$. Divide both sides by $0.8$ to find $p = \\frac{64}{0.8} = 80$. **Multiplication Check:** Apply the 20% discount to $80 by multiplying by $0.8$: $80 \\times 0.8 = 64$, which confirms the correct final price. (By comparison, checking $76.8$ gives $76.8 \\times 0.8 = 61.44 \\neq 64$.)",
          "nextQuestion": "To make sure this clicks, what equation would you set up if an item cost $64 after a 20% sales tax (an increase) was added to the original price $p$?",
          "suggestedAction": "Practice setting up an equation for a percent increase problem.",
          "model": "gemini-4-argon"
        }
      }
    },
    {
      "label": "reverse-percentage: scripted fresh transfer answer",
      "route": "/api/study/generate/answer",
      "method": "POST",
      "startedAt": "2026-10-23T03:16:26.941Z",
      "expected": 200,
      "requestBody": {
        "sessionId": "17564de6-9819-4274-9afe-9e2ce96f1c97",
        "answer": "125",
        "elapsedSeconds": 30,
        "answerChanges": 0
      },
      "completedAt": "2026-10-23T03:16:27.359Z",
      "status": 200,
      "expectedStatusPassed": true,
      "response": {
        "isCorrect": true,
        "correctAnswer": "125",
        "explanation": "The final price is 120% of the original: 1.2p = 150, so p = 125. Multiplying 125 by 1.2 returns 150."
      }
    }
  ],
  "cases": [
    {
      "id": "distribution-linear",
      "question": "Solve 4(x - 3) = 2x + 10. What is the value of x?",
      "reference": "4x - 12 = 2x + 10, so 2x = 22 and x = 11. Substitution gives 32 = 32. At x = 5, the two sides are 8 and 20.",
      "wrongAnswer": "5",
      "transfer": {
        "question": "Solve 5(x + 2) = 3x + 24. What is the value of x?",
        "answer": "7",
        "reference": "5x + 10 = 3x + 24, so 2x = 14 and x = 7. Substitution gives 45 = 45."
      },
      "requests": [
        "distribution-linear: explanation before attempt",
        "distribution-linear: hint",
        "distribution-linear: next step",
        "distribution-linear: scripted wrong attempt",
        "distribution-linear: explanation after attempt",
        "distribution-linear: scripted fresh transfer answer"
      ],
      "wrongAnswerMarkedIncorrect": true,
      "transferMarkedCorrect": true,
      "persistedExpectedAttempts": true
    },
    {
      "id": "reverse-percentage",
      "question": "After a 20% discount, a jacket costs $64. What was its original price in dollars?",
      "reference": "The final price is 80% of the original: 0.8p = 64, so p = 80. Multiplying 80 by 0.8 returns 64. Increasing 64 by 20% instead gives 76.8 and uses the wrong base.",
      "wrongAnswer": "76.8",
      "transfer": {
        "question": "After a 20% increase, an annual membership costs $150. What was the original price in dollars?",
        "answer": "125",
        "reference": "The final price is 120% of the original: 1.2p = 150, so p = 125. Multiplying 125 by 1.2 returns 150."
      },
      "requests": [
        "reverse-percentage: explanation before attempt",
        "reverse-percentage: hint",
        "reverse-percentage: next step",
        "reverse-percentage: scripted wrong attempt",
        "reverse-percentage: explanation after attempt",
        "reverse-percentage: scripted fresh transfer answer"
      ],
      "wrongAnswerMarkedIncorrect": true,
      "transferMarkedCorrect": true,
      "persistedExpectedAttempts": true
    }
  ],
  "review": {
    "method": "AI-assisted editorial read against the fixed references. This is not teacher review, a blinded assessment, or a population accuracy estimate.",
    "registeredIntegrationChecks": "Both original workflows met the registered access, answer-handling and persistence expectations.",
    "qualitativeIssues": [
      {
        "case": "distribution-linear",
        "observation": "The mathematically correct explanation discussed an empty choices list and described a possible dropped-term error as common without shown later work or frequency evidence."
      },
      {
        "case": "reverse-percentage",
        "observation": "The mathematically correct explanation mentioned absent multiple-choice options and called 76.8 the most common trap answer without supporting frequency evidence."
      }
    ],
    "otherLimits": [
      "The percentage hint repeats its diagnostic question in both message and nextQuestion. Concision is not scored by this protocol.",
      "All fresh transfer answers were submitted by a scripted client that already knew the reference, so they do not measure learning."
    ]
  },
  "privacy": "Only synthetic original tasks and script-supplied answers are shown. Account identity, cookies and fixture UUIDs are omitted. No student records, credentials or hidden thinking are included."
}
