Web Applications and Data

Cedar cumulative release investigation

Original on-site instruction. Practice and outside references are optional. Independent subject review and observed learner testing remain pending.

This additional original investigation connects the preparation lessons to the preserved course capstone. It does not replace that project or its rubric. Use fictional records and disposable fixtures throughout. A written design and controlled demonstration establish instructional evidence, not production security approval or observed professional competence.

Establish the contract before interpreting the incident

Cedar serves two tenants. Each accepted work order has a tenant, stable order identifier, version, description and integer cents. A signed-in member may read and edit only orders authorized to that member. An edit supplies an expected version and a stable operation identifier scoped to its tenant. The server validates the proposed fields and commits the domain change, replay result and audit record together. Repeating the same operation with the same request returns its recorded result; reusing it with different content is a conflict. A stale different operation must not silently overwrite a newer edit.

The report shows one row per accepted order. The report's customer total repeats on each order row, while a running total follows a unique sequence within the authorized customer partition. Its overall total is computed from order amounts once each. Browser loading, successful empty results and errors are distinct states. A later selection owns the visible report even if an earlier request finishes last.

Stage one: contradictory release evidence

The release team supplies these observations:

1. The form displays a disabled tenant selector. Its request handler reads the submitted tenant and uses a parameterized UPDATE. An integration test edits only a fixture belonging to the signed-in tenant. 2. A description containing `<img src=x onerror=alert(1)>` is inserted with textContent in one browser view. An administrative template marks the same description safe. The write endpoint accepts cookie-authenticated POST requests without the framework's CSRF validation. 3. Version 7 is read by two editors. The first changes the description and commits version 8. The second request updates by order identifier alone and returns success. Its operation identifier is newly generated on every transport retry. 4. The SQL report joins order lines and payments before summing. One order has two lines of 500 cents and three payments. A proposed repair uses SUM(DISTINCT line_cents). Another report sums the repeated customer_total column from a window query. 5. The browser issues request A, then B. B returns an empty authorized list; A later returns three rows and overwrites it. The error handler also clears whichever rows are currently displayed without checking request identity. 6. A private response has Cache-Control: public, max-age=600. A proxy key uses the URL alone. An operator changes the origin header to private and declares the earlier cached body erased. 7. The CI log names commit R, but the deployed artifact was built from an uncommitted working tree. A new column is mandatory in the new application, while the old application still writes records without it. A logical dump exists, but no restore has been attempted.

For each observation, state what the evidence establishes, what it does not establish, the smallest coherent correction, and the controlled check that could falsify the proposed repair. Do not treat one passing happy-path test as an answer to a different failure mechanism.

Stage two: changed records

After your first proposal, Cedar adds three facts. Tenant B happens to use the same local order identifier and operation identifier as tenant A. An external notification provider times out after it may have accepted a request. Finally, the report gains an order with no lines, and two equal-valued lines remain legitimate separate facts on another order.

Revise your design without deleting these inconvenient records. Explain how tenant scoping, request identity, empty aggregate policy and uncertain external effects change your earlier reasoning. Identify a boundary that cannot be settled by the available evidence.

Compare the complete cumulative reasoning

Complete model reasoning

The disabled selector is presentation. A forged request can change its value, and parameter binding prevents a different class of error: submitted values becoming SQL syntax. Derive tenant scope from verified identity and server permissions, authorize the specific object, and constrain the mutation accordingly. Test cross-tenant identifiers and permitted versus forbidden fields. The existing same-tenant test supports only its observed path. Include tenant B's colliding local identifiers so a missing scope predicate becomes visible.

The textContent observation supports safe text insertion at that one sink. It does not repair the administrative template. Keep untrusted descriptions in the appropriate escaped text context there, and inspect any separate URL, attribute or script context by its own rules. Restore framework CSRF validation for ambient-cookie state changes and keep GET free of mutation. A CSRF token is not an object permission check, and an escaped template does not authorize a request. Test these mechanisms separately with controlled sessions and payloads; do not infer a security certification.

Use an expected-version predicate in the authorized update and inspect whether exactly one row changed. The first editor's accepted change leaves the second operation stale. Preserve the first change and return an explicit conflict for the second rather than pretending both succeeded. A stable operation identifier must survive transport retries. Store the request identity and outcome in the same local transaction as the accepted mutation and audit event. Tenant-scoped keys allow A and B to use the same local identifier without replaying one tenant's result to the other. A repeated identical request returns the original outcome; a changed request under that key conflicts.

The two lines total 1000 cents. Joining each to three payments produces six rows and a false line total of 3000. DISTINCT on the amount returns 500 and discards a legitimate separate line. Aggregate lines and payments independently to their declared grain before joining their results. Preserve the no-line order with an outer join and state whether its total is zero under the domain contract. COALESCE can implement that decision but cannot decide it. Do not sum window customer totals repeated across order rows: sum the underlying order amounts once, or use a separate customer-grain result. Verify both equal-valued facts and the no-line order.

B's empty success is the current result. Its emptiness does not grant A authority to replace it. Associate success and error handling with the same current request generation, and check relevance before either mutates visible state. Abort can save work but does not replace this relevance rule. Use controlled promises to resolve B before A and reject an obsolete request after a newer success. Verify loading, current empty, current error and retained successful state explicitly.

The earlier public cache policy creates a distinct serving problem. Correct private response storage policy and cache selection at every relevant layer, but do not equate a future origin header with deletion of a previously stored proxy object. Identify and invalidate the affected entries using the actual serving mechanism; verify isolation with separate controlled identities and the served response. The supplied record cannot establish how far the old representation propagated or whether every copy was removed. Report that uncertainty accurately.

Build and identify the artifact from the exact reviewed revision, then test that artifact in its serving environment. A successful log for R does not identify an artifact built from other content. Introduce the schema in a compatible expansion phase, deploy code that tolerates the transition, backfill and validate before enforcing the later requirement or removing compatibility. Rehearse a restore in a disposable environment and check application-visible data, schema and configuration together. A dump file alone supplies no measured recovery time or successful recovery evidence.

The notification timeout is not proof of failure. Keep external delivery separate from the local atomic transaction and retain a durable delivery/reconciliation record. Use a provider-supported stable idempotency key where its documented contract permits, and reconcile uncertain outcomes before issuing a genuinely new action. A local transaction cannot roll back an already accepted external effect. The record does not establish provider retention, duplicate suppression or delivery guarantees; those remain explicit dependencies.

Submission and rubric

Submit an annotated request-to-database-to-response flow, a table of each violated contract and repair, representative controlled fixtures with expected outcomes derived independently, and a revised release decision after the changed facts. Attach the exact source/artifact identifiers used in any executable demonstration. Separate executed observations from predictions and production questions.

Evaluate five criteria, each from zero to four points: (1) accurate identity, authority, representation and security boundaries; (2) transaction, version, replay and external-effect reasoning; (3) correct relational grain, empty policy and window interpretation; (4) observable asynchronous, cache and delivery behavior; (5) independent changed-condition evidence and an honest release/recovery decision. Four points require a correct mechanism, worked record trace and changed-condition explanation; three indicate a correct mechanism with a material evidence omission; two indicate partial reasoning with an unresolved contradiction; one identifies the issue without a viable mechanism; zero omits it or contradicts the contract. The twenty-point written rubric supplements the preserved capstone and does not award a credential or establish practical competency.