Error reference

Every error Velaris can give, from the error table in the compiler source, which the test suite holds against every code the compiler can raise, so this page cannot go stale. In the message templates, braces are filled with your program’s names and values; every error also arrives with numbered fixes, and as JSON with --json.

CodeWhat it meansMessage template
E000a character the lexer cannot read, or a run that stopped without a Velaris error to reportunexpected character {source[pos]!r}
E001the program's file cannot be foundcannot find file '{path}'
E002an unknown escape sequence in a text literalunknown escape '\\{e}' in text
E100the parser expected something else hereexpected '{want}' but found '{t.text or 'end of file'}'
E101a token that cannot start an expression hereunexpected '{t.text}'
E102an expression that nests, or chains operators, too deeply, or blocks nested too deeplyblocks nest more than {BLOCK_NEST_LIMIT} deep here (an 'if', 'while', 'for' or 'else if' inside another)
E200an unknown function, or an import with no such function'{ns}' has no function called '{fname}'
E204a function named like a built-in, which would shadow it'{n}' is the name of a built-in, so a function called '{n}' would shadow it; through 7.x the built-in silently won and this function was never reached
E300an effect used but not declared in 'uses', or a name in 'uses' that is not an effectfunction '{fn.name}' declares '{unknown[0]}', which is not an effect; the effects are {', '.join(ALL_EFFECTS)}
E310an effect outside the run's budget (while running); or a promise that calls a function with effects or uses 'try'the '{where}' promise of '{fn.name}' calls '{node.name}' which has effects ({', '.join(sorted(eff))}); promises must be pure
E311a Python module outside the run's ffi: grants was reached'{what}' reaches {described}, whose owning Python module cannot be determined; this run allows ffi:{granted} and refuses what it cannot place
E313a path outside the run's fs grants'{what}' reaches '{path}' (resolved: {real}), which this run's fs grants do not cover
E314a host or port outside the run's net grants'{what}' reaches host '{host}', which this run does not allow: {why}
E315the run's fs or net operation count was reached'{what}' is the {_state.OP_COUNTS[kind]}{_ordinal(_state.OP_COUNTS[kind])} {kind} operation, and this run allows {limit}
E316a file larger than the read ceiling (raise it with --max-read)'{args[0]}' is {size} bytes, over the read ceiling of {_state.MAX_READ_BYTES} bytes - a file is read whole, into memory, so a large one is capped
E317a network request whose socket peer is a proxy the run's net grants do not cover (an ambient HTTP_PROXY / HTTPS_PROXY)an ambient proxy ({proxy}) would carry this request, and its host {peer}:{port} is outside this run's net grants: a net grant bounds the URL's host, and from 8.0 also the socket's peer
E318read_file on a documented credential location; read a secret with read_file_secret, or grant its exact path'{what}' reaches '{path}' (resolved: {real}), a documented credential location the fs grants do not name explicitly; a broad grant does not include it
E400there is no 'main' functionthere is no 'main' - a program needs somewhere to start
E401the wrong number of arguments, or parameters on 'main''{node.name}' expects {len(ptypes)} argument(s) but got {len(node.args)}
E402an unknown variable, or break or continue, which the language does not haveunknown variable '{node.name}': it is not defined where this function value is written, nor in it
E403division or remainder by zero while runningpercent_of with a denominator of zero
E405random(n) with n less than 1random(n) needs n greater than 0
E406the placeholders in a format text and the values given do not matchthis text has {holes} placeholder(s) but got {given} value(s)
E407a whole number grew past 64 bitsthis whole number has {len(t.text)} digits (whole numbers go from -9223372036854775808 to 9223372036854775807)
E408an exit code outside 0 to 255an exit code must be between 0 and 255, not {code}
E500an unknown type
E501types do not match'{node.name}' here is the builtin, which needs {want} for argument {i}; the function '{node.name}' of this program is hidden by it
E502a value is needed from a function that returns nothingargument {i} of '{node.name}' is a call to a function that returns nothing
E503a return does not match the declared return type'{fn.name}' promises to return {declared_ret} but this return gives nothing
E504an 'if' or 'while' condition that is not a Bool'while' needs a yes/no condition (Bool), but this is {c}
E505a requires, ensures or invariant that is not a Bool'invariant' must be a yes/no promise (Bool)
E506an empty list or map with no type to say what it holdscannot tell what an empty list holds
E507a record defined twice, a field given twice in a record, or one name used for a record and a function'{r.name}' is used for both a record and a function
E508an unknown recordunknown record '{node.name}'
E509a record value with a missing, unknown or repeated field, or a map with a repeated keyrecord '{node.name}' is missing field(s): {', '.join(missing)}
E510a field that the value does not haverecord '{t}' has no field '{node.field}'
E511a record changed in placerecords cannot be changed in place
E512an imported file cannot be foundcannot import '{path}': it is not UTF-8 text, so it is not Velaris source
E513a function or record defined in two filesfunction '{f.name}' is defined {where}
E514a variable named like an import'{name}' is the name of an import, so it cannot also be a variable
E515an import from outside the directory a program is served from, or of a file there that is not a .vel filecannot import '{path}': {why}
E520a failure that is ignored: a call that can fail, not handled with check or passed up with try'get' on a map can fail - the key may be missing, and that cannot be ignored
E521'try' in a function that cannot fail, or a failure that escaped the program while running'try' passes failure up, but '{fn.name}' cannot fail
E522'try' or 'check' on a call that cannot fail'{shown_name(node.subject.name)}' cannot fail - call it directly, no check needed
E523'fail' in a function that does not declare 'or fail''fail' is used, but '{fn.name}' does not declare it can fail
E524'main' declared 'or fail''main' cannot be 'or fail' - there is no one above it to handle the failure
E525a check's ok arm names the result of a call that returns nothing, or leaves a returned value unnamed'{node.subject.name}' returns nothing - write 'ok {{ ... }}' with no name
E530a function passed as a value that has effects or can fail'{f2.name}' uses effects ({', '.join(sorted(f2.effects))}) - only pure functions can be passed as values
E540a type variable that appears only in the return typetype variable '{tv}' must appear in at least one parameter (a {tv} only in the return type cannot be inferred)
E541a type variable named like a real typetype variable '{tv}' shadows a real type
E542an argument that does not fit the shape a generic function's type variables took'{node.name}' argument {i} should look like {want}, but this is {got}
E543a generic function passed as a value'{f2.name}' is generic - generic functions cannot be passed as values yet
E550amounts in two different currencies added, compared, or one given where the other is needed
E551a currency that is not in velaris.CURRENCIES, or one not written as text in the callthe currency must be written in the call, as text
E552a rounding mode other than "half_up", "half_even" or "down", or one not written as text in the callthe rounding mode must be written in the call:
E553an amount divided with '/' or '%', which would round without saying how'{op}' on an amount would round without saying how
E560a Secret given to something that emits it: a builtin with an effect, a generic function with an effect, or a 'fail' reason{what} is {t}, and {where} - a Secret cannot be printed, written, sent or passed to Python. It came from {origin}
E561declassify without a reason written as text in the call, or given something that is not a Secretthe reason given to '{said}' must be written as text in the call
E562a Secret of a Secreta Secret of a Secret is the same secret; write {inner}
E563an 'if' or 'while' branching on a value derived from a Secret'{kind}' would branch on {t}, which came from {origin} - a program does not choose what to do by looking at a secret. A comparison over one gives a Secret of Bool exactly so that this is refused: in a loop it would read the secret out a character at a time
E600a 'requires' broke while runningbroken promise: {nice_name(name)} requires {expr_str(expr)} ({vals(expr)})
E601an 'ensures' broke while runningbroken promise: {nice_name(name)} ensures {expr_str(expr)} ({vals(expr, (retval,))})
E602a position outside a list or text while runningposition {i} is outside the text (it has {len(t)} character(s))
E607a text grew too large to build, or there was no input to readthis text grew too large to build
E608a file could not be writtencould not write '{str(args[0]).replace(chr(0), chr(92) + '0')}': a path cannot hold a NUL character
E609recursion too deep, a value nested too deeply, or split by empty text'{name}' called itself {DEPTH_LIMIT} deep - this looks like recursion that never stops
E610the run's time limit was reached and the program stoppedthe program ran longer than {self.timeout} second(s) and was stopped
E611the run's memory cap was reached and the program stoppedthe program used more than {self.max_memory_mb} MB and was stopped
E612a loop whose end cannot be shown (check --strict only)
E613a check or audit ran past its time ceiling and was stoppedthe {what} did not finish within {self.timeout:g} second(s) and was stopped; the source may be crafted to stall the checker
E614a check or audit grew past its memory ceiling and was stoppedthe {what} used more than {self.max_memory_mb} MB and was stopped; the source may be crafted to bloat the checker
E700a promise that is provably false, with the input that breaks itpromise cannot be kept: {nice_name(fn.name)} ensures {expr_str(ens_expr)} - proven without running the program: {vals} gives result = {rv}
E701a call that can break the called function's 'requires', with the input that doesthis call can break a promise: '{fnB.name}' requires {expr_str(r_expr)}, but '{ctx.caller}' can call it with {vals} - proven without running the program
E703a loop invariant the prover cannot show holdscannot prove the loop keeps 'invariant {expr_str(inv_expr)}' {where} in '{ctx.caller}' - the promises allow: {vals}
E704a loop invariant broke while runningloop broke its promise: invariant {expr_str(inv_expr)} ({vals})
E705a list read the prover shows can go past the endthis 'get' can reach position {m.eval(idx, model_completion=True)}, but the list has {m.eval(length, model_completion=True)} item(s) - proven without running the program
E706a divisor the prover shows can be zerothis can {word} zero
E999the self-test in 'velaris doctor' failedself-test failed

Findings that are not compile errors

What velaris check --sarif, proofs --sarif, audit --sarif and capabilities check --sarif report besides the codes above, at the level SARIF reports each at.

RuleLevelWhat it means
unproven-promisewarninga requires or ensures that is checked while the program runs, not proven before it runs
contract-coveragenotea function that takes or returns data and promises nothing about it
loop-not-shown-to-endnotea loop the termination rule cannot show to end; check --strict refuses it as E612
ffi-nativenotea granted Python module ships native code (a compiled extension: .so/.pyd/.dylib), found on disk without importing it; there is no source to read and a budget does not contain what it does
secret-sourcenotea builtin that hands the program a Secret (env, read_file_secret); the compiler will not let its result be printed, written or sent
secret-declassifiedwarninga declassify call turns a Secret into an ordinary value, with a stated reason; an error under check --strict unless the reason is listed in --allow-declassify-reasons
uses-ionotea function that may perform io: the console
uses-envnotea function that may perform env: environment variables
uses-fsnotea function that may perform fs: files
uses-netnotea function that may perform net: the network
uses-clocknotea function that may perform clock: the time
uses-randnotea function that may perform rand: randomness
uses-ffinotea function that may perform ffi: Python, and so anything Python can do
uses-declassifynotea function that may perform declassify: turning a Secret into an ordinary value, which anything may then emit
capability-widenederrorcode that needs a grant velaris.capabilities does not give: an effect, a Python module, a path outside the recorded ones, a host, a scoped grant made unscoped, or more fs or net operations in a run than recorded (capabilities check)
capability-effect-gainederrora function velaris.capabilities records now declares an effect it did not declare there (capabilities check)
capability-narrowednotevelaris.capabilities gives more than the code needs now; capabilities init --force records the narrower surface
dependency-capability-widenederroran upgraded Velaris dependency needs a grant its previous version did not: an effect, a Python module, a path, a host, or more fs or net operations in a run (deps-diff)
dependency-effect-gainederrora function of an upgraded Velaris dependency declares an effect it did not declare in the previous version (deps-diff)
dependency-install-scripterroran upgraded dependency runs an install-time script its previous version did not, or a different one; what the script does is not derived (deps-diff)
dependency-surface-unknownnotean upgraded dependency holds code other than Velaris, or could not be read, so what it can do was not derived; unknown is not safe (deps-diff)
dependency-addednotea dependency the upgraded version declares that the previous one did not; its own surface was not examined (deps-diff)
dependency-narrowednotean upgraded Velaris dependency needs less than its previous version did (deps-diff)

Removed codes

None. A code that stops being given is listed here, and is never given again for anything else (STABILITY.md).