Lawfare Group → Knowledge Institute → Lawfare Academy

Programming & Software Development: connected independent written study

November 1, 2026: the three-course, eighteen-unit independent nondegree conceptual/applied written core and integration meet the scoped internal self-contained standard. Independent human subject review and observed learner testing remain pending. This content decision does not record learner completion or establish practical competence.

Preparation, progression and required coverage

This is a three-course, three-stage pathway comprising eighteen native units. All required teaching is on LawfareGroup.com. Publisher links are optional references; no external textbook purchase, chapter assignment or account is required. Start with basic arithmetic and a computer with Python 3 for optional local execution. Reading remains open without installing software. Prior programming is not assumed at entry. If considering a later AI pathway, study that pathway's mathematics requirements separately; AI301 is not a hidden requirement here.

1. CS101 Programming Foundations with Python: values, expressions, branches, loops, functions, collections, files, exceptions and tests. Before progressing, trace a loop's changing state, distinguish a returned value from printed output, preserve record identity in a collection, and explain a rejected input.
2. CS201 Data Structures, Algorithms and Systems: specifications, correctness, growth, representations, sorting/search, recursion, trees, graphs and systems/resource reasoning. The original onsite reader supplies discrete mathematics and proof preparation. Before progressing, state an invariant, justify a representation for a specific query, trace a boundary case and distinguish an asymptotic model from observed timing.
3. CS220 Web Applications, SQL and Software Engineering: application requests, relational data, constraints, transactions, authorization, accessible interfaces and recovery. Connect these mechanisms to the first two courses instead of treating a framework's output as a correctness argument.

All three courses are required in the preserved curriculum; there are no elective groups or optional courses within this program. Additional practice is voluntary. A learner can revisit any earlier lesson without changing a completion record. Suggested time varies with preparation; testing and writing a complete investigation take longer than reading its model.

The intended outcome is a proportionate written explanation and bounded implementation of a fictional application, including its contracts, intermediate reasoning, failures and reproducible evidence. This is an independent nondegree conceptual/applied written pathway. It does not establish supervised practical competence, employment readiness, accreditation, academic credit, professional eligibility or an independently observed learner outcome. Independent human subject review and observed learner testing remain pending.

Integration investigation from a value to a durable response

The three required stages address different failure boundaries. Programming foundations supply values, control flow, functions, collections, files, validation and reproducible tests. Algorithms supplies specifications, invariants, representations and resource models. Persistent web applications adds request parsing, identity/authorization, relational constraints, transactions, interface semantics and recovery. Reading a later implementation is easier after the preceding mechanisms are understood; access remains unlocked. No AI course is required in this three-course curriculum. The catalog's generic statement about mathematics before AI301 concerns an optional later AI pathway, not an additional hidden requirement in Programming & Software Development.

The program outcome is to explain, build and evaluate a bounded fictional data application with a reproducible test record. That includes specifying what each function promises, preserving identity during transformations, choosing a representation for the actual query, maintaining consistent persistent state and explaining what a failure proves. “The page loads” is only a display observation. A correct aggregate does not establish authorization; an authorized request can still lose an update; a transaction can faithfully commit a wrong calculation. Review those claims separately.

The Harbour maintenance service

Harbour starts with two fictional accounts, North and South, and an inventory of three identical inspection slots. Each booking consumes one slot. The initial event stream is:

EventOwnerBookingSlotsMeaning
E1NorthB11Create
E2SouthB21Create
E1NorthB11Exact retry
E3NorthB32Create

Define the contract before coding. The event ID identifies a logical operation and is bound to owner, booking and slot count. An exact retry returns the earlier result without consuming inventory again. A repeated event ID with different content is a conflict, not a new operation. Slots are positive integers within a stated limit, and owner identity comes from a trusted authenticated context, not merely a submitted JSON field. A booking belongs to exactly one owner. Reading a missing booking or another owner's booking returns the defined absence response without leaking its contents. The exercise uses fictional identity fixtures; it does not supply a production identity service.

Complete worked model: E1 succeeds and leaves two slots. E2 succeeds and leaves one. The repeated E1 returns B1's earlier success and leaves one. E3 asks for two while only one remains, so it is rejected without creating B3 or consuming a partial amount. Accepted unique creations are B1 and B2; booked slots total two; available slots equal one. Summing every input row would count the retry twice, while allowing negative quantities could manufacture stock. Treating an E1 retry as a conflicting create merely because B1 already exists would also violate the intended idempotency contract.

At the programming boundary, parse and validate the complete request before changing a report or database. Keep parsing, business validation, state transition and serialization as distinguishable functions so tests can isolate them. At the algorithm boundary, a booking-ID dictionary supports exact identity lookup; an owner-to-booking index supports an owner list. It must preserve all owned bookings rather than overwrite the previous one. At the persistent boundary, uniqueness and inventory predicates must be enforced where concurrent requests meet. A precheck that reads inventory in one transaction and decrements it later can race: two workers may both see the same last slot. A conditional update and booking/event record must share a transaction or another explicitly justified atomic boundary. Return success only after the required commit succeeds.

Independent expected results should be written before running the implementation: one exact retry creates no extra effect; a changed payload under E1 is rejected; a missing event field is rejected before mutation; one owner cannot read or edit another's booking; an absent booking is handled safely; an exhausted inventory request leaves both inventory and booking rows unchanged. A schema constraint is useful evidence for one invariant, not proof of every endpoint's business policy. Tests should inspect the committed fixture state through a fresh connection when persistence is the claim.

Changed facts: an ambiguous response and a stale view

After the database commits E2, the response is lost. South retries E2. The correct result is the same logical booking with no second inventory decrement. A caller timeout is not evidence that the operation never happened. A new event ID would describe a new operation and could duplicate the effect. Stable identity, stored payload comparison and a durable prior result connect the retry to the committed action. If the service cannot determine the prior outcome, it must report the uncertainty under a defined recovery policy rather than invent success or absence.

Now a background worker caches North's booking list and North cancels B1. A cached list still containing B1 is fast but inconsistent with the source. Decide whether reads require the current committed version, may use a labeled snapshot or tolerate bounded staleness. Invalidate or update the index/cache under that policy. Do not silently mix new inventory with an old booking snapshot and present them as a single consistent view. If cancellation restores a slot, the booking transition and inventory restoration also need a shared transaction and an idempotent cancellation identity so repeated cancellation cannot create stock.

The user interface should expose these states in text that does not rely on color. A labeled booking form, keyboard-operable controls, associated error messages and a clear response region help users understand the result. Keep a rejected operation's fields available where appropriate without displaying another owner's data. An accessible confirmation is not itself evidence of a durable commit, and a durable commit must not be reported as a rejection merely because a rendering step failed. Test the boundary between server result and displayed state.

Compare resource choices using the contract

Suppose there are n bookings and q owner-list queries. A complete scan can inspect n records per query. An owner index costs construction, extra memory and update maintenance, then locates a list whose explicit output still costs at least its length. If every query rebuilds the index, the earlier static-index crossover no longer applies. If the data does not fit memory, page-oriented storage and I/O become relevant. If owner checks occur only after serializing results, a fast index can leak data before the check. Correctness, authorization and performance are cumulative obligations.

An optional program submission can be a private notebook or local repository containing the contract, a transition table, the exact fixture, a small implementation, invariant arguments, independent expected results, observed test output and a changed-facts revision. A complete worked response supplies the E1/E2/E3 calculation above, an explicit transaction boundary, a durable retry mechanism, cache consistency policy and accessible error behavior. A statement that a framework “handles security” omits the endpoint's ownership decision and is not enough.

Use an optional 100-point rubric: contracts/identity20, programming/data transformations15, algorithm/resource reasoning15, persistence/concurrency/recovery20, authorization/accessibility15, and reproducible evidence/changed-facts revision15. Award the full dimension only when the response supplies the specified mechanism, intermediate reasoning and failure evidence; about three quarters when one minor detail is missing, half for partially correct work with a material gap, one quarter for labels without a working argument, and zero for missing or contradictory work. Do not total around a known cross-owner disclosure or duplicate inventory effect: identify and repair that failure first. Scores are private instructional feedback, not Academy awards or verified readiness.

Progressive optional practice with complete model reasoning

Practice 1: validation and identity

Before any mutation, classify these requests: an exact retry of E1; E1 with Slots changed to2; a new event with Slots0; a new event with Slots supplied as the text "one"; and a request whose submitted owner differs from its authenticated fixture identity. Explain the order of checks and why a successful parse is insufficient.

Open full model reasoning and changed facts

Model reasoning: an exact E1 retry matches the stored owner, booking and quantity and returns its recorded result without consuming another slot. E1 with a different quantity conflicts with the prior payload. Zero violates the positive-integer business constraint. Text "one" fails the specified numeric input representation rather than being silently guessed. A submitted owner cannot override authenticated identity; the server must derive the trusted owner and reject an inconsistent operation. Parsing establishes a representation; business validation establishes admissibility; ownership authorizes access. These are distinct obligations. The model assumes the service retains a durable event-to-payload/result binding, not merely a process-local set that disappears after restart.

Changed facts: an HTTP parser accepts true as a JSON boolean, and a language represents booleans as a subtype of integer. Must it become one slot? No. The stated contract requires an integer quantity, not a boolean. Validate the input type explicitly before a permissive conversion. A successful conversion is not evidence of the caller's intended quantity.

Practice 2: choosing and maintaining an index

North has bookings B1 and B4; South has B2. Compare a booking-ID dictionary, a single owner-to-booking dictionary and an owner-to-list-of-booking-IDs index. Explain deletion and the cost of returning a long result.

Open full model reasoning and changed facts

Model reasoning: booking-ID lookup locates one booking, after which the request's owner still needs authorization. A single owner-to-booking value overwrites B1 when B4 is assigned and loses a valid relation. An owner-to-list or set of booking IDs represents the one-to-many relation; a subsequent lookup returns both B1 and B4 and validates that the authoritative records still belong to North. Deleting B1 must remove or invalidate its index membership under the chosen consistency policy. Returning k bookings costs at least proportional to k for explicit serialization even if locating the index entry is expected constant time. Hashing is an average-case representation model, not a worst-case guarantee or proof of privacy.

Changed facts: B4 moves to another owner in an allowed administrative fixture operation. Update the authoritative ownership relation and both affected index memberships within a justified consistency boundary. An old cached North response must not reveal B4's new contents. A cache key without the caller's authorized identity or visibility version can mix distinct security contexts.

Practice 3: two callers and the last slot

There is one slot left. Two workers each read1 and each independently decide to create a one-slot booking. Describe the faulty schedule and one corrected atomic design.

Open full model reasoning and changed facts

Model reasoning: read-check-write outside one atomic boundary permits both workers to observe1. Both can create bookings and subtract from the same stale observation, producing either overselling or a lost update. Within a transaction, conditionally decrement inventory only where available>=requested. Check that exactly one inventory row was affected, then create the booking and durable event result in that same transaction. Any constraint failure rolls back all related changes. A second transaction must observe the changed state under the database's documented concurrency semantics or fail and retry safely. This is a design argument; actual database behavior must be tested with the specified engine/isolation rather than assumed from the word transaction.

Changed facts: the event record insert conflicts because an identical retry already committed. Roll back this attempted transition and fetch/compare the durable prior event result through the defined retry path. Do not keep its inventory decrement and merely suppress the duplicate exception. A conflicting payload receives a conflict response; it cannot inherit another operation's success.

Practice 4: cancellation, response loss and readable evidence

B1 is canceled, its cancellation response is lost, and the caller retries. A browser still shows an old booking list. Explain the committed state, retry and interface evidence.

Open full model reasoning and changed facts

Model reasoning: a cancellation is a state transition with a stable operation identity. The first successful transition marks B1 canceled and restores exactly its booked quantity in the same transaction. An exact retry returns the recorded cancellation result and restores nothing again. If only B2 remains active, booked slots equal1 and available slots equal2 from the original total3. A stale list is not evidence that cancellation failed. The interface should identify its snapshot or refresh under the stated policy, present textual success/uncertainty/error states and avoid disabling keyboard access to recovery controls. A network timeout is an unknown response outcome until reconciliation establishes the committed transition. Preserve the event chronology and inspect committed fixture state through a fresh connection when persistence is the claim.

Changed facts: a crash occurs before commit rather than after it. Atomic rollback means no committed cancellation or restoration should remain. Recovery must determine this from durable evidence and safely retry the same operation. A process log saying started is not a committed outcome.

Cumulative response and explicit assessment criteria

A complete optional response contains the original transition table, identity/payload contract, validation rules, representation argument, transaction and retry design, ownership decision, accessibility states, independently written expected outcomes, actual fixture observations and one changed-facts revision. The complete worked argument above is a model, not a requirement to store a submission online.

Apply the 100-point dimensions stated above: contracts/identity20; programming/data transformations15; algorithm/resource reasoning15; persistence/concurrency/recovery20; authorization/accessibility15; reproducible evidence/changed facts15. For each dimension, full credit requires the mechanism, intermediate trace and counterexample; three quarters allows a minor omission; half recognizes correct partial reasoning with a material gap; one quarter recognizes labels without the mechanism; zero indicates absence or contradiction. Record a cross-owner disclosure or duplicate inventory effect as an unresolved failure even if the arithmetic total looks favorable. Repair and rerun the relevant fixture before describing that claim as supported. No rubric score confers an Academy award or a verified learner outcome.

Onsite course and laboratory route

Use the preserved program curriculum for current course versions and personal study progress. Open CS101 for programming mechanisms, CS201 for representation/proof/resource teaching, and CS220 for persistent application boundaries. The Algorithms resource-safe laboratory is an optional fictional local execution companion; its full Windows/SQLite/loopback selftest passed after explicit connection closure. The original shared laboratory remains preserved with its documented Windows cleanup failure and must not be described as passing. No real customer records, credentials or provider transactions belong in these fixtures.

The program's written integration review reuses documented full constituent editorial and live evidence after comparing all current accepted fields exactly. That comparison does not mean all eighteen units were freshly reread during the whole-program review. A local arithmetic check, a code selftest and actual browser navigation each establish bounded evidence; none establishes independent human subject review or observed learner learning.