DEV Community

kongkong
kongkong

Posted on

"Put MonkeyCode Tasks Behind an Approval-Gated API Contract"

A user approves a plan, then the base SHA changes. An approved=true Boolean can authorize different work from what was reviewed. For a MonkeyCode integration, bind approval to immutable task evidence. The promotion is transparent; the contract is tool-independent.

// Unexecuted example
type Plan={id:string;repo:string;baseSha:string;requirementHash:string;allowedPaths:string[];expiresAt:string}
type Approval={planId:string;planHash:string;approverId:string;approvedAt:string}
Enter fullscreen mode Exit fullscreen mode
POST /coding-plans -> 201 Plan
POST /coding-plans/:id/approvals -> 201 Approval
POST /coding-plans/:id/executions -> 202 Operation
GET /operations/:id -> durable status
Enter fullscreen mode Exit fullscreen mode

Execution reloads and hashes the plan, compares the current repository SHA, authorizes the reviewer, enforces expiry, and atomically creates one operation per idempotency key. The browser's Boolean is never authority.

// Unexecuted pseudocode
transaction(async tx => {
 const old=await tx.operation.byKey(key); if(old) return old;
 const plan=await tx.plan.lock(planId);
 assert(hash(plan)===(await tx.approval.get(planId)).planHash);
 assert(await currentSha(plan.repo)===plan.baseSha);
 assert(Date.now()<Date.parse(plan.expiresAt));
 return tx.operation.create({key,planId,state:"queued"});
});
Enter fullscreen mode Exit fullscreen mode
Failure Response Persistent outcome
changed SHA 409 stale_plan no operation
expired plan 410 plan_expired no operation
wrong reviewer 403 forbidden denial audit
duplicate key original response one operation

Display repository, base SHA, allowed paths, checks, and expiry before approval. Rollback by disabling creates, revoking access, reconciling queued work, preserving safe records, and invalidating old hashes.

Verified product boundary

The official README describes MonkeyCode as open-source under AGPL-3.0. Its overseas online option supplies managed server-side cloud environments and areas for development, model, task, requirement, build, test, and preview work.

Review record fields

For review pass 1 in this kongkong1 evaluation, record an owner, repository, base commit, requirement revision, allowed paths, start and stop times, expected checks, observed terminal state, reviewer decision, cleanup proof, and unresolved questions. Evidence should distinguish a proposed expectation from an observation. Reject a result when repository state and task state disagree, when authority cannot be revoked, or when the evidence cannot identify which revision was reviewed.

Review record fields

For review pass 2 in this kongkong1 evaluation, record an owner, repository, base commit, requirement revision, allowed paths, start and stop times, expected checks, observed terminal state, reviewer decision, cleanup proof, and unresolved questions. Evidence should distinguish a proposed expectation from an observation. Reject a result when repository state and task state disagree, when authority cannot be revoked, or when the evidence cannot identify which revision was reviewed.

Limitations

This kongkong1 method was not executed against a live MonkeyCode environment. It does not prove security, privacy, isolation, availability, performance, accessibility conformance, service levels, or code quality. Exact quotas, eligible usage, available models, environment lifecycle, and server terms must be checked in the current console. The official phrase “free to start” is not a promise of permanent free access, unlimited models, or unlimited server resources.

Supporting official project material is at https://github.com/chaitin/MonkeyCode. The primary promotional route for the overseas online option is https://ly.cyberserval.tech/iIETXiF.

Disclosure: This article promotes MonkeyCode using an official campaign link. I’m a MonkeyCode user, not affiliated with the project, and I receive no commission from this link.

AI assistance disclosure: This article was drafted with AI assistance and reviewed against the cited project materials.

Top comments (0)