Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Local configuration only. Never place provider credentials in client variables.

# Desktop provider: meta by default, baseten, or opencode-go.
MOKE_PROVIDER=meta
SECOND_SET_PROVIDER=meta

# Meta Model API hackathon key. Meta's docs call this MODEL_API_KEY.
MODEL_API_KEY=
Expand All @@ -24,10 +24,10 @@ OPENCODE_API_KEY=
MODAL_TOKEN_ID=
MODAL_TOKEN_SECRET=
MODAL_ENVIRONMENT=main
MOKE_MODAL_APP=moke-reviews
MOKE_MODAL_IMAGE=moke-review-engine:latest
MOKE_MODAL_TIMEOUT_MINUTES=15
SECOND_SET_MODAL_APP=second-set-reviews
SECOND_SET_MODAL_IMAGE=second-set-review-engine:latest
SECOND_SET_MODAL_TIMEOUT_MINUTES=15
# Optional short-lived warm sandbox; omit to avoid idle compute charges.
# MOKE_MODAL_POOL_QUEUE=moke-review-pool
# SECOND_SET_MODAL_POOL_QUEUE=second-set-review-pool
# Packaged builds: private JSON configuration, permissions 600 on Unix.
# MOKE_MODAL_CONFIG=/absolute/path/to/modal-session.json
# SECOND_SET_MODAL_CONFIG=/absolute/path/to/modal-session.json
2 changes: 1 addition & 1 deletion .project-kit/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"schemaVersion": 1,
"generatorVersion": "0.1.0",
"settings": {
"name": "moke-meta-hackathon",
"name": "second-set",
"profile": "desktop",
"authentication": "undecided"
},
Expand Down
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# moke-meta-hackathon
# second-set

Use the Bun version in .bun-version. Run bun run verify before handing back implementation changes.
Use Bun for installs, scripts, checking, formatting, tests, and desktop/backend builds.
Expand Down
6 changes: 3 additions & 3 deletions PRODUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MOKE
# Second Set

<!-- impeccable:product-schema 1 -->

Expand All @@ -16,7 +16,7 @@ conversation. A review does not require an existing finding or count check.
Bun and Effect own APIs, SQLite, migrations, PDF processing and Pi Durable
execution. Electron owns the trusted bridge, file dialogs and credential storage.

The full MOKE AGENTS.md, shared review method and applicable discipline files
The full vendored AGENTS.md, shared review method and applicable discipline files
supply Pi's system instructions. Whole-set review includes the general and all
discipline instructions; a discipline review includes general context and its
selected instructions. The review inventories the supplied documents, reads
Expand Down Expand Up @@ -85,7 +85,7 @@ chooser, with a revision label requested for subsequent imports. The composer
names its model, reviewer, revision and whole-set, selected-sheet or discipline
scope. Optional sheet discipline assignments persist independently of count
verification. Explicit scopes take precedence over request wording. User requests appear as chat
bubbles, followed by elapsed progress and MOKE's saved response. A note is saved
bubbles, followed by elapsed progress and Second Set's saved response. A note is saved
without starting inference. Active reviews accept durable follow-up instructions
from the composer and show their delivery state. Findings open their source
evidence in a central canvas with zoom (including Ctrl+scroll and trackpad pinch),
Expand Down
45 changes: 30 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Moke
# Second Set

Moke is a desktop workbench for reviewing engineering drawing packets, built for
Second Set is a desktop workbench for reviewing engineering drawing packets, built for
the Meta AI Developer Hackathon. Import the drawings and ask for a whole-set QA
pass or a discipline review. Moke reads source images, follows its review
pass or a discipline review. Second Set reads source images, follows its review
instructions, records findings and coverage, and produces an offline HTML report.
Follow-up requests can deepen the review while retaining earlier issue IDs.

[Watch the narrated demo on YouTube](https://youtu.be/wl8wwq_Tlrw).
[Watch the narrated demo on YouTube](https://youtu.be/wl8wwq_Tlrw). Second Set was called
MOKE until November 9, 2026, so the demo and earlier records use that name.

![Moke's five-sheet review with 19 findings, coverage gaps, and findings navigation](docs/screenshots/workbench.png)
![Second Set's five-sheet review with 19 findings, coverage gaps, and findings navigation](docs/screenshots/workbench.png)

## The review workflow

Expand All @@ -18,7 +19,7 @@ Follow-up requests can deepen the review while retaining earlier issue IDs.
drawing set" or "Review the electrical design and supporting calculations."
Choose a model and reviewer, or let Auto route the request. A saved note does
not start inference.
3. **Follow the inspection.** Moke inventories the supplied sheets, opens source
3. **Follow the inspection.** Second Set inventories the supplied sheets, opens source
images and detail crops, and records the four review passes: document
completeness, code and agency requirements, coordination, and prior comments.
A Florida code index points each check to its code section, statute or rule.
Expand All @@ -40,9 +41,8 @@ Follow-up requests can deepen the review while retaining earlier issue IDs.
![A saved false-alarm decision beside the source drawing and SAM highlight](docs/screenshots/correction.png)

Revision reviews carry earlier findings into the revised sheets. The demo also
shows a finding that remained open on a 13-sheet set reviewed on October 31.

![A revision recheck retains an unresolved area discrepancy and the reviewer's decision](docs/screenshots/revision.png)
shows [a finding that remained open](https://youtu.be/wl8wwq_Tlrw?t=122) on a
13-sheet set reviewed on October 31.

Drawn-to-schedule count comparisons remain available as specialized checks.
Reviewers accept their count inputs and coverage before deterministic comparison;
Expand All @@ -59,12 +59,26 @@ dimensions.
## Install

Download the installer for Windows, macOS (Apple silicon) or Linux from
[GitHub Releases](https://github.com/sc-frederick/moke-meta-hackathon/releases/latest).
[GitHub Releases](https://github.com/Surfside-Software/second-set/releases/latest).
The installers are unsigned. macOS can block the first launch; allow it under
System Settings › Privacy & Security › Open Anyway. On Linux, make the AppImage
executable or install the `.deb`. Model reviews need a provider key; see
[inference setup](docs/inference.md).

### Upgrading from MOKE 0.2.2

- Second Set installs as a new app beside MOKE and opens MOKE's projects from the same
data folder. Don't run both at once; uninstall MOKE when you're done with it.
- On macOS and Linux, keys saved in MOKE may not unlock. Enter them again in Review
settings or import them from the File menu; the keys that still unlock keep working.
- A review paused in MOKE can't resume. Start a new review; finished reviews and their
reports are unchanged.
- `MOKE_*` environment variables are now `SECOND_SET_*`, for example
`SECOND_SET_MODAL_CONFIG` and `SECOND_SET_SESSION_CREDENTIAL_FILE`. A saved Modal
configuration needs `appName` `second-set-reviews` and `imageName`
`second-set-review-engine:latest`, and each provider Secret needs the key
`SECOND_SET_API_KEY`; see [cloud reviews](docs/cloud-reviews.md).

## How it works

| Process | Owns |
Expand All @@ -78,7 +92,7 @@ over authorized Electron MessagePorts; Electron forwards application requests to
Bun over authenticated loopback HTTP. Database access and provider credentials
stay outside the renderer.

Pi Durable journals the review and runs the full Moke system instructions. A
Pi Durable journals the review and runs the full vendored review instructions. A
separate ledger records model and SAM intent before dispatch, preserving unknown
outcomes without automatic resends. Reviews have pause and cancel controls and an
optional call budget. The default packet review has no application call ceiling;
Expand Down Expand Up @@ -158,13 +172,14 @@ repository began on October 27, 2026. The [rules and evidence review](docs/valid
maps the public repository, Meta model integration, demo, and source attribution
to the participant guide checked on November 4.

The Moke name, review prompts, and the owner's 2023 Florida Building Code
plan-review reference predate this entry. The code index tooling and
The review prompts and the owner's 2023 Florida Building Code plan-review
reference predate this entry. The code index tooling and
`florida-code-additions.md` were added during the hackathon; see the
[code index provenance](backend/review/code-index/README.md).
This repository implements a fresh application from the project-kit desktop starter, with drawing evidence,
corrections, and revision tracking built for the hackathon. It does not reuse the
earlier Moke application. Pi Durable provides agent execution as an MIT-licensed
earlier MOKE application. The project was renamed from MOKE to Second Set on
November 9, 2026, and no longer uses the MOKE name. Pi Durable provides agent execution as an MIT-licensed
dependency; the new work is the drawing-review application, evidence handling,
corrections, revision behavior and portable review execution. Prompt and
dependency provenance live in
Expand All @@ -173,7 +188,7 @@ dependency provenance live in

## License

Moke is released under the [MIT License](LICENSE). Vendored code and third-party
Second Set is released under the [MIT License](LICENSE). Vendored code and third-party
assets keep their own licenses. The styles in `src/lib/forge.css` are adapted from
Uiverse Design's Forge and remain under its license; see
[the design notes](docs/design.md).
2 changes: 1 addition & 1 deletion backend/cloud/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const writeCloudCacheState = (path: string, state: CloudCacheState) =>
* letters, digits, dashes, periods and underscores, and must be shorter than 64 characters.
*/
export const cloudCacheVolumeName = (appName: string, id: string) =>
`${appName}-cache-${id}`.length < 64 ? `${appName}-cache-${id}` : `moke-cache-${id}`;
`${appName}-cache-${id}`.length < 64 ? `${appName}-cache-${id}` : `second-set-cache-${id}`;

/** Content-addressed originals and renders in the local artifact store. */
export const listLocalArtifacts = (dataDirectory: string) =>
Expand Down
9 changes: 7 additions & 2 deletions backend/cloud/contracts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ import { codeIndexVersion } from "../review/code-index/code-index.ts";
export const cloudEngineIdentity = {
// Protocol 4 workers read unchanged source files from the workspace cache Volume.
// Protocol 5 workers add the Florida code index, code search and PDF source text.
protocol: 5,
// Protocol 6 workers keep their files under /second-set and read SECOND_SET_ variables.
protocol: 6,
engine: packageEngineFormat,
prompt: reviewPromptVersion,
instructions: reviewInstructionRevision,
Expand Down Expand Up @@ -69,7 +70,7 @@ export const CloudReviewRecord = Schema.Struct({
id: CloudReviewId,
// Unmarked receipts predate protocol-aware admission and may name a running v2 worker.
// Protocol 3 receipts remain readable so already dispatched work can still return.
workerProtocol: Schema.optionalKey(Schema.Literals([3, 4, cloudEngineIdentity.protocol])),
workerProtocol: Schema.optionalKey(Schema.Literals([3, 4, 5, cloudEngineIdentity.protocol])),
revision: Schema.Int.pipe(Schema.withDecodingDefaultKey(Effect.succeed(0))),
syncFailure: Schema.NullOr(CloudReviewError).pipe(
Schema.withDecodingDefaultKey(Effect.succeed(null)),
Expand Down Expand Up @@ -100,6 +101,10 @@ export const CloudReviewRecord = Schema.Struct({
/** Persisted record type stays private to cloud application and adapters. */
export type CloudReviewRecord = typeof CloudReviewRecord.Type;

/** Workers before protocol 6 shipped under the MOKE name and keep their files under /moke. */
export const cloudWorkerRoot = (record: Pick<CloudReviewRecord, "workerProtocol">) =>
record.workerProtocol === cloudEngineIdentity.protocol ? "/second-set" : "/moke";

/**
* Provider injection uses the canonical application route and a separately supplied secret. A
* custom endpoint is not a cloud route: its key stays on the computer that saved it.
Expand Down
Loading
Loading