Skip to content

Make enterprise arithmetic commit explicit - #4

Merged
EmergentMonk merged 9 commits into
mainfrom
heresy/pr4-explicit-commit-trigger
Sep 5, 2026
Merged

EmergentMonk merged 9 commits into
mainfrom
heresy/pr4-explicit-commit-trigger

Conversation

@EmergentMonk

@EmergentMonk EmergentMonk commented Sep 5, 2026 •

Copy link
Copy Markdown
Member

Summary

Makes COMMIT ENTERPRISE ARITHMETIC the actual execution trigger for the HERESY API Calculator and promotes the live GitHub Pages site in the README.

Behavior change

Previously, changing an operand, operation, or interface style recalculated immediately, so pressing the large enterprise button often appeared to do nothing because the work had already happened.

Now:

  1. edits only stage the request
  2. no arithmetic executes on input or select changes
  3. the report starts blank
  4. submitting the form via COMMIT ENTERPRISE ARITHMETIC performs the calculation
  5. failures still clear stale report state before displaying the error

The UI now says explicitly that inputs are staged locally until enterprise arithmetic is committed.

Documentation

The README now prominently links the live calculator:

https://qsolkcb.github.io/HERESY-API/

It also documents the staged-request / explicit-commit behavior.

Regression coverage

  • DOM smoke test verifies the calculator does not calculate on load
  • verifies no change handlers are registered for operands, operation, or style
  • stages 9 × 4 and proves the result remains blank until form submission
  • verifies the submit handler prevents default navigation and returns 36
  • verifies division-by-zero still clears stale output when submitted
  • static test pins the staged-request UI copy
  • static test pins the live Pages URL and commit-button documentation in README

The joke now requires actual management approval before arithmetic can proceed.

Summary by Sourcery

Make enterprise arithmetic execute only after users explicitly commit a staged calculator request.

New Features:

  • Require users to explicitly commit staged calculator requests before arithmetic is executed.

Bug Fixes:

  • Prevent stale calculation reports from persisting when staged inputs are changed or a submitted calculation fails.

Enhancements:

  • Present a blank report until the first successful commit and clearly communicate the staged-request workflow in the calculator UI.

Documentation:

  • Prominently link the live GitHub Pages calculator and document its staged-request and explicit-commit behavior in the README.

Tests:

  • Expand browser and static coverage for blank initial state, staged edits, explicit submission, failure handling, UI copy, and the live Pages link.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry @EmergentMonk, you've used your own review budget of 250,000 diff characters for the last 7 days.

You can request another review in 2 days and 9 hours by commenting @sourcery-ai review. Upgrade to get a review now.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-05T17:28:53.990539Z 8eb4f85 Manual request
🔒 Security Review ✅ Completed 2026-09-05T17:11:51.982641Z c597d57 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@sourcery-ai

sourcery-ai Bot commented Sep 5, 2026

Copy link
Copy Markdown

Reviewer's Guide

Changes the calculator from implicit recalculation to an explicit enterprise-commit workflow, updates the UI and README to explain and promote it, and adds coverage for deferred execution and failure-state cleanup.

Sequence diagram for explicit enterprise arithmetic commit

sequenceDiagram
    actor User
    participant Calculator as Calculator UI
    participant Form as Form submit handler
    participant Report as Report

    User->>Calculator: Edit operand, operation, or style
    Calculator-->>User: Stage inputs locally
    Note over Calculator: No change handlers execute arithmetic
    User->>Form: Submit COMMIT ENTERPRISE ARITHMETIC
    Form->>Report: clearReport()
    Form->>Form: calculate()
    alt valid arithmetic
        Form-->>Report: Display result
    else division by zero or other failure
        Form-->>Report: Display error with stale output cleared
    end
Loading

Flow diagram for staged calculator request and explicit commit

flowchart TD
    A[Calculator loads] --> B["clearReport()"]
    B --> C[User edits calculator inputs]
    C --> D[Request remains staged]
    D --> E{Form submitted}
    E -->|No| D
    E -->|Yes| F["calculate()"]
    F --> G{Arithmetic succeeds}
    G -->|Yes| H[Display result]
    G -->|No| I[Clear stale report and display error]
Loading

File-Level Changes

Change Details Files
Make form submission the sole arithmetic execution path and keep the report empty until commit.
  • Remove operand, operation, and style change listeners.
  • Clear the report on initialization instead of calculating defaults.
  • Retain submit-time calculation and stale-output clearing on failures.
web/app.js
Expose the staged-request workflow directly in the calculator UI.
  • Add explanatory copy that inputs remain staged until enterprise arithmetic is committed.
  • Keep the existing explicit commit button as the submission control.
web/index.html
Document and promote the live GitHub Pages calculator.
  • Add the live Pages URL and launch link.
  • Document that edits stage requests and execution requires the commit button.
README.md
Add regression coverage for deferred execution, explicit submission, error cleanup, and documentation.
  • Verify blank initial output and absence of recalculation change handlers.
  • Verify staged 9 × 4 produces 36 only after submit and prevents default navigation.
  • Verify division-by-zero clears prior output.
  • Pin staged-request UI copy and README Pages/commit documentation.
tests/app_dom_smoke.js
tests/test_web.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c597d57491

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread web/app.js
Comment thread web/app.js

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@EmergentMonk

Copy link
Copy Markdown
Member Author

@codex please review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Nice work!

Reviewed commit: 8eb4f8586e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@EmergentMonk
EmergentMonk merged commit 6aa5f64 into main Sep 5, 2026
2 checks passed
@EmergentMonk
EmergentMonk deleted the heresy/pr4-explicit-commit-trigger branch September 5, 2026 17:33
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