Commit 9555889
committed
fix(compiler): harden config-driven entity types (crash-proof + complete the override)
Review of the config-entity-types feature surfaced two real issues:
- A config 'entity_types' value containing '{' or '}' was substituted into the
prompt template BEFORE .format() ran → KeyError/ValueError crashing every
compile. Swap to format-then-replace at all 3 call sites (types_str is now an
inert literal), and sanitize resolved types to a safe label charset (also
skips YAML nulls/ints so str(None) can't become the type 'none').
- The AGENTS_MD system schema hardcoded 'type: is one of: <7 defaults>',
contradicting a custom entity_types in the higher-weight system message.
Reword it to frame those as the configurable default and defer the
authoritative set to the compilation prompt (which is config-driven).
Also drop the now-dead _ENTITY_TYPES_STR + its stale import-time-substitution
comment. +2 regression tests (sanitization; brace-in-type doesn't crash).1 parent cea1b5e commit 9555889
3 files changed
Lines changed: 58 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | | - | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
79 | 78 | | |
80 | 79 | | |
81 | 80 | | |
| |||
101 | 100 | | |
102 | 101 | | |
103 | 102 | | |
104 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
105 | 108 | | |
106 | 109 | | |
107 | 110 | | |
| |||
1416 | 1419 | | |
1417 | 1420 | | |
1418 | 1421 | | |
1419 | | - | |
1420 | | - | |
1421 | | - | |
| 1422 | + | |
1422 | 1423 | | |
1423 | 1424 | | |
1424 | | - | |
| 1425 | + | |
1425 | 1426 | | |
1426 | 1427 | | |
1427 | 1428 | | |
| |||
1669 | 1670 | | |
1670 | 1671 | | |
1671 | 1672 | | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
| 1673 | + | |
1675 | 1674 | | |
1676 | | - | |
| 1675 | + | |
1677 | 1676 | | |
1678 | 1677 | | |
1679 | 1678 | | |
| |||
1707 | 1706 | | |
1708 | 1707 | | |
1709 | 1708 | | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
| 1709 | + | |
1713 | 1710 | | |
1714 | 1711 | | |
1715 | | - | |
| 1712 | + | |
1716 | 1713 | | |
1717 | 1714 | | |
1718 | 1715 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
126 | 135 | | |
127 | 136 | | |
128 | 137 | | |
| |||
1919 | 1928 | | |
1920 | 1929 | | |
1921 | 1930 | | |
| 1931 | + | |
| 1932 | + | |
| 1933 | + | |
| 1934 | + | |
| 1935 | + | |
| 1936 | + | |
| 1937 | + | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
| 1944 | + | |
| 1945 | + | |
| 1946 | + | |
| 1947 | + | |
| 1948 | + | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
1922 | 1963 | | |
1923 | 1964 | | |
1924 | 1965 | | |
| |||
0 commit comments