amos 73a5240295 Batches 21 and 18: add 74 calibrated tasks (40 Bos redo, 34 HWE code-gen)
Batch 21 (20261027-A-bos-redo-21) rebuilt 40 of the 53 rejected Bos-qiao
environments: hidden assertions that ran inside the candidate's process
now run in a trusted parent that reads observations from a low-UID
worker; gold bytes are unchanged. 9 were excluded for scope (ROS2,
oversize, security core), 3 are blocked because the source requires an
exec bit the platform does not freeze, 1 lacks requests/bs4 in trace6.

Batch 18 (20261026-C-hwe-codegen-18) adds its last 34 of 134 tasks; the
first 100 landed in 2f32624d.

Claude reviewed 74/74 USABLE against current digests, canonical
families, no ID or source overlap with main, plain public docs. Only the
new task directories are taken; the stale pre-batch-20 copies of
concur-release-capsule and resource-temp-link on the batch 21 branch and
both branches' progress notes stay as main has them. Difficulty is
unmeasured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-02 10:23:12 +08:00

70 lines
1.6 KiB
C++

#pragma once
#include <cstdint>
#include <iosfwd>
#include <memory>
#include <vector>
namespace identity {
enum class Code { OK, RANGE, MISSING, EXISTS, BUSY, ZOMBIE, DENIED, NOT_CHILD, RUNNING, NO_GROUP, CROSS_SESSION };
struct Result { Code code; int value; };
struct Process {
Code code;
int pid;
int ppid;
int pgid;
int sid;
bool live;
int status;
bool group_leader;
bool session_leader;
};
struct Group {
Code code;
int id;
int sid;
int members;
bool leader_live;
std::uint64_t mask;
};
struct Session {
Code code;
int id;
int groups;
int members;
bool leader_live;
std::uint64_t mask;
};
struct Stats {
int tracked;
int live;
int zombies;
int groups;
int sessions;
std::uint64_t births;
std::uint64_t exits;
std::uint64_t reaps;
};
class Ledger {
public:
Ledger();
~Ledger();
Ledger(const Ledger&) = delete;
Ledger& operator=(const Ledger&) = delete;
Result seed(int pid);
Result fork_process(int parent, int child);
Result setsid(int pid);
Result setpgid(int caller, int target, int group);
Result exit_process(int pid, int status);
Result reap(int parent, int child);
Process inspect(int pid) const;
Group group(int pgid) const;
Session session(int sid) const;
Stats stats() const;
std::vector<Process> snapshot() const;
private:
struct Impl;
std::unique_ptr<Impl> data_;
};
struct CliResult { int lines; int syntax; int errors; bool limited; };
CliResult run_cli(Ledger&, std::istream&, std::ostream&);
}