mirror of
https://github.com/hanzoai/cloud.git
synced 2026-11-17 16:36:24 +00:00
`go build ./cmd/cloud` failed on a fresh clone: the feature-flag evaluator linked a Rust staticlib nobody had built, and there were no make targets at all. The evaluator moves behind `-tags flags_native`, because cgo is on by default and already links C — only an explicit tag can mean "the Rust archive exists". Cold build now takes 37s and needs nothing but Go. The encryption refusal contradicted itself. It offered "or run a pure-Go dev build" as the way out while running ON one, having just logged that encryption was off. Both statements came from a time when !cgo meant "cannot encrypt"; hanzoai/sqlite reports EncryptionAvailable() == true under both build tags now, so the pure-Go build is exactly as capable and exactly as refusing. The route is deleted, not the refusal — a build that CAN encrypt and has no key must keep failing closed. `make dev` mints a real key instead of an exemption, so the laptop runs the production path. Three local apps, every route a typed op: base (documents), tasks (a durable queue with atomic lease/ack), functions (registry + runner, STAGED because it executes code). No kv and no sql — base is already both, and two more doors onto one room would be two more names to keep in agreement. Typed ops are the reason /mcp answers at all. zip projects its op registry into MCP, the schema'd OpenAPI document and the call plane, but it does that from Listen, which runs after the console catch-all is registered — so the endpoint existed and still 404'd. Prepare() moves ahead of the catch-all. 19 MCP tools and 22 JSON schemas where there were none, because there were zero typed ops in this tree before. Plugins build on first request instead of at boot. The manifest is still validated at boot — a typo must not wait for traffic — but a plugin whose source is missing no longer takes the whole binary down with it. The console is embedded and served at /, through a serveFS that takes an fs.FS so the serving code stays single. A /v1 miss is still JSON: a client expecting JSON never receives an HTML shell. PORT is read when CLOUD_LISTEN says nothing. It was the first thing everyone tried and the one thing that did nothing. .githooks/pre-push refuses any push to origin carrying commits or imports from the private edition. It treats every refs/remotes namespace that is not origin as private, which catches forgeall/* and incx/* — leftovers from removed remotes holding thousands of private commits that an enumerated list misses.
32 lines
1.3 KiB
Go
32 lines
1.3 KiB
Go
//go:build !cgo || !flags_native
|
|
|
|
package flags
|
|
|
|
// The default build carries no native evaluator. Every evaluation errors, so
|
|
// resolve() falls back to env/default and the HTTP surface answers 503 —
|
|
// fail-safe, never fail-wrong.
|
|
//
|
|
// This is the DEFAULT half of the pair, and deliberately so. The native
|
|
// evaluator is a Rust staticlib that has to be compiled before Go can link it,
|
|
// so making it the default made `go build ./cmd/cloud` fail on a fresh clone
|
|
// with a linker error about a missing .a file — a Rust toolchain as the price of
|
|
// admission to a Go project, and a first impression that reads as "the tree is
|
|
// broken". Feature-flag evaluation is one subsystem; it should not be able to
|
|
// stop the binary from being built at all.
|
|
//
|
|
// So the native engine moved behind its own tag (`-tags flags_native`, or
|
|
// `make native`) and the fallback became what you get by default. Note that the
|
|
// tag is what selects it, not cgo: cgo is ON in a default build and links plenty
|
|
// of C already, so keying on cgo alone could never express "cgo, but no Rust".
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
const engineAvailable = false
|
|
|
|
func engineEvaluate(_, _ []byte) (json.RawMessage, error) {
|
|
return nil, fmt.Errorf("flags: native evaluator not built (build with -tags flags_native after `make native`)")
|
|
}
|